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

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: update Created 7 years 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
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ime/input_method_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 41cea85395bb798d82958c6112d37263aee5b784..d88fccfc6ff3ffdc90dcdbc32ff21d30cce1823b 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -4,7 +4,9 @@
#include "ui/base/ime/input_method_base.h"
+#include "base/bind.h"
#include "base/logging.h"
+#include "base/message_loop/message_loop.h"
#include "ui/base/ime/input_method_delegate.h"
#include "ui/base/ime/input_method_observer.h"
#include "ui/base/ime/text_input_client.h"
@@ -130,4 +132,38 @@ void InputMethodBase::SetFocusedTextInputClientInternal(
NotifyTextInputStateChanged(text_input_client_);
}
+void InputMethodBase::OnCandidateWindowShown() {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&InputMethodBase::CandidateWindowShownCallback, AsWeakPtr()));
+}
+
+void InputMethodBase::OnCandidateWindowUpdated() {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&InputMethodBase::CandidateWindowUpdatedCallback,
+ AsWeakPtr()));
+}
+
+void InputMethodBase::OnCandidateWindowHidden() {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&InputMethodBase::CandidateWindowHiddenCallback, AsWeakPtr()));
+}
+
+void InputMethodBase::CandidateWindowShownCallback() {
+ if (text_input_client_)
+ text_input_client_->OnCandidateWindowShown();
+}
+
+void InputMethodBase::CandidateWindowUpdatedCallback() {
+ if (text_input_client_)
+ text_input_client_->OnCandidateWindowUpdated();
+}
+
+void InputMethodBase::CandidateWindowHiddenCallback() {
+ if (text_input_client_)
+ text_input_client_->OnCandidateWindowHidden();
+}
+
} // namespace ui
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ime/input_method_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698