Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: ui/base/ime/input_method_base.cc

Issue 80583002: [FYI] All-in-one OnCandidateWindow{Show,Update,Hide} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/ime/input_method_base.cc
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc
index 44d52fa292043fb1b275404b4f6baf6c93ce0ba4..8ee7698dd647c3f6f56f4182eb5a788f082f8126 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -14,7 +14,8 @@ namespace ui {
InputMethodBase::InputMethodBase()
: delegate_(NULL),
text_input_client_(NULL),
- system_toplevel_window_focused_(false) {
+ system_toplevel_window_focused_(false),
+ is_candidate_popup_open_(false) {
}
InputMethodBase::~InputMethodBase() {
@@ -132,6 +133,18 @@ void InputMethodBase::NotifyTextInputStateChanged(
OnTextInputStateChanged(client));
}
+void InputMethodBase::NotifyCandidateWindowStateChanged() {
+ bool new_state = IsCandidatePopupOpen();
+ if (!is_candidate_popup_open_ && new_state) {
+ text_input_client_->OnCandidateWindowShow();
+ } else if (is_candidate_popup_open_ && new_state) {
+ text_input_client_->OnCandidateWindowUpdate();
+ } else if (is_candidate_popup_open_ && !new_state) {
+ text_input_client_->OnCandidateWindowHide();
+ }
+ is_candidate_popup_open_ = new_state;
+}
+
void InputMethodBase::SetFocusedTextInputClientInternal(
TextInputClient* client) {
TextInputClient* old = text_input_client_;

Powered by Google App Engine
This is Rietveld 408576698