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 |