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

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

Issue 13845017: ime: Implement the observer list for FakeInputMethod. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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/fake_input_method.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/fake_input_method.cc
diff --git a/ui/base/ime/fake_input_method.cc b/ui/base/ime/fake_input_method.cc
index 5b330ee18cd2e95539abfc52e794fab4cc4ef2b7..66e2215abaf809ca769361892fe51d48912769c8 100644
--- a/ui/base/ime/fake_input_method.cc
+++ b/ui/base/ime/fake_input_method.cc
@@ -51,6 +51,8 @@ void FakeInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) {
void FakeInputMethod::SetFocusedTextInputClient(TextInputClient* client) {
text_input_client_ = client;
+ FOR_EACH_OBSERVER(InputMethodObserver, observers_,
+ OnTextInputStateChanged(client));
}
TextInputClient* FakeInputMethod::GetTextInputClient() const {
@@ -111,7 +113,10 @@ bool FakeInputMethod::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) {
void FakeInputMethod::Init(bool focused) {}
void FakeInputMethod::OnFocus() {}
sadrul 2013/04/16 02:25:18 Is it necessary to trigger the observer callback f
Seigo Nonaka 2013/04/16 07:49:18 I think no as far as virtual keyboard is not the c
sadrul 2013/04/16 15:14:56 Ah, cool. Thanks!
void FakeInputMethod::OnBlur() {}
-void FakeInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {}
+void FakeInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {
+ FOR_EACH_OBSERVER(InputMethodObserver, observers_,
+ OnTextInputStateChanged(client));
+}
void FakeInputMethod::OnCaretBoundsChanged(const TextInputClient* client) {}
void FakeInputMethod::CancelComposition(const TextInputClient* client) {}
@@ -135,7 +140,12 @@ bool FakeInputMethod::CanComposeInline() const {
return true;
}
-void FakeInputMethod::AddObserver(InputMethodObserver* observer) {}
-void FakeInputMethod::RemoveObserver(InputMethodObserver* observer) {}
+void FakeInputMethod::AddObserver(InputMethodObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void FakeInputMethod::RemoveObserver(InputMethodObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
} // namespace ui
« no previous file with comments | « ui/base/ime/fake_input_method.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698