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

Unified Diff: ui/base/ime/input_method_base.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/input_method_base.h ('k') | ui/base/ime/mock_input_method.h » ('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 23d21ba46122aef0d0ef17b77399df6858b7d0b1..1ab79421eae9d91277da0fb86e57c917e68703bb 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -52,6 +52,15 @@ void InputMethodBase::SetFocusedTextInputClient(TextInputClient* client) {
NotifyTextInputStateChanged(text_input_client_);
}
+void InputMethodBase::DetachTextInputClient(TextInputClient* client) {
+ if (text_input_client_ == client) {
+ OnWillChangeFocusedClient(client, NULL);
+ text_input_client_ = NULL;
+ OnDidChangeFocusedClient(client, NULL);
+ NotifyTextInputStateChanged(text_input_client_);
+ }
+}
+
TextInputClient* InputMethodBase::GetTextInputClient() const {
return system_toplevel_window_focused_ ? text_input_client_ : NULL;
}
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ime/mock_input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698