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

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

Issue 23478020: Makes sure that an input method doesn't reference to a destroyed object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Worked on nits. Created 7 years, 3 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') | ui/base/ime/input_method.h » ('j') | 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 15f1283e19f94a8e798b245105f6953ae8735e40..952108c54dba261794c83ef24537aa21c160881c 100644
--- a/ui/base/ime/fake_input_method.cc
+++ b/ui/base/ime/fake_input_method.cc
@@ -55,6 +55,14 @@ void FakeInputMethod::SetFocusedTextInputClient(TextInputClient* client) {
OnTextInputStateChanged(client));
}
+void FakeInputMethod::DetachTextInputClient(TextInputClient* client) {
+ if (text_input_client_ == client) {
+ text_input_client_ = NULL;
+ FOR_EACH_OBSERVER(InputMethodObserver, observers_,
+ OnTextInputStateChanged(client));
+ }
+}
+
TextInputClient* FakeInputMethod::GetTextInputClient() const {
return text_input_client_;
}
« no previous file with comments | « ui/base/ime/fake_input_method.h ('k') | ui/base/ime/input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698