Commit e10cfd2e authored by Jing Wang's avatar Jing Wang Committed by Commit Bot

Add click button api to suggestion handler interface

Bug: 1099498
Change-Id: I7ca8fdfbb145332bdb6cda54dbf59c86f7f86104
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2279344
Commit-Queue: Jing Wang <jiwan@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785281}
parent aebabdd8
...@@ -47,6 +47,8 @@ class TestSuggestionHandler : public SuggestionHandlerInterface { ...@@ -47,6 +47,8 @@ class TestSuggestionHandler : public SuggestionHandlerInterface {
return false; return false;
} }
void ClickButton(const ui::ime::AssistiveWindowButton& button) override {}
bool AcceptSuggestionCandidate(int context_id, bool AcceptSuggestionCandidate(int context_id,
const base::string16& candidate, const base::string16& candidate,
std::string* error) override { std::string* error) override {
......
...@@ -176,6 +176,11 @@ bool InputMethodEngine::SetButtonHighlighted( ...@@ -176,6 +176,11 @@ bool InputMethodEngine::SetButtonHighlighted(
return true; return true;
} }
void InputMethodEngine::ClickButton(
const ui::ime::AssistiveWindowButton& button) {
observer_->OnAssistiveWindowButtonClicked(button);
}
bool InputMethodEngine::AcceptSuggestionCandidate( bool InputMethodEngine::AcceptSuggestionCandidate(
int context_id, int context_id,
const base::string16& suggestion, const base::string16& suggestion,
......
...@@ -127,6 +127,8 @@ class InputMethodEngine : public InputMethodEngineBase, ...@@ -127,6 +127,8 @@ class InputMethodEngine : public InputMethodEngineBase,
bool highlighted, bool highlighted,
std::string* error) override; std::string* error) override;
void ClickButton(const ui::ime::AssistiveWindowButton& button) override;
bool AcceptSuggestionCandidate(int context_id, bool AcceptSuggestionCandidate(int context_id,
const base::string16& candidate, const base::string16& candidate,
std::string* error) override; std::string* error) override;
......
...@@ -73,6 +73,8 @@ class TestSuggestionHandler : public SuggestionHandlerInterface { ...@@ -73,6 +73,8 @@ class TestSuggestionHandler : public SuggestionHandlerInterface {
return false; return false;
} }
void ClickButton(const ui::ime::AssistiveWindowButton& button) override {}
bool SetButtonHighlighted(int context_id, bool SetButtonHighlighted(int context_id,
const ui::ime::AssistiveWindowButton& button, const ui::ime::AssistiveWindowButton& button,
bool highlighted, bool highlighted,
......
...@@ -52,6 +52,9 @@ class SuggestionHandlerInterface { ...@@ -52,6 +52,9 @@ class SuggestionHandlerInterface {
bool highlighted, bool highlighted,
std::string* error) = 0; std::string* error) = 0;
// Click the given button in assitive window.
virtual void ClickButton(const ui::ime::AssistiveWindowButton& button) = 0;
virtual bool AcceptSuggestionCandidate(int context_id, virtual bool AcceptSuggestionCandidate(int context_id,
const base::string16& candidate, const base::string16& candidate,
std::string* error) = 0; std::string* error) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment