blob: 783a57422b9f7f99f414cf5f37fb41763d5098bd [file] [log] [blame]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/input_method/fake_suggestion_handler.h"
namespace chromeos {
bool FakeSuggestionHandler::DismissSuggestion(int context_id,
std::string* error) {
showing_suggestion_ = false;
dismissed_suggestion_ = true;
suggestion_text_ = u"";
confirmed_length_ = 0;
return true;
}
bool FakeSuggestionHandler::SetSuggestion(
int context_id,
const ui::ime::SuggestionDetails& details,
std::string* error) {
showing_suggestion_ = true;
context_id_ = context_id;
suggestion_text_ = details.text;
confirmed_length_ = details.confirmed_length;
return true;
}
bool FakeSuggestionHandler::AcceptSuggestion(int context_id,
std::string* error) {
showing_suggestion_ = false;
accepted_suggestion_ = true;
suggestion_text_ = u"";
confirmed_length_ = 0;
return true;
}
void FakeSuggestionHandler::OnSuggestionsChanged(
const std::vector<std::string>& suggestions) {}
bool FakeSuggestionHandler::SetButtonHighlighted(
int context_id,
const ui::ime::AssistiveWindowButton& button,
bool highlighted,
std::string* error) {
return false;
}
void FakeSuggestionHandler::ClickButton(
const ui::ime::AssistiveWindowButton& button) {}
bool FakeSuggestionHandler::AcceptSuggestionCandidate(
int context_id,
const std::u16string& candidate,
std::string* error) {
return false;
}
bool FakeSuggestionHandler::SetAssistiveWindowProperties(
int context_id,
const AssistiveWindowProperties& assistive_window,
std::string* error) {
return false;
}
} // namespace chromeos