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

Unified Diff: ui/views/ime/input_method_bridge.cc

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bot failure: cast_shell_linux Created 5 years, 6 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
Index: ui/views/ime/input_method_bridge.cc
diff --git a/ui/views/ime/input_method_bridge.cc b/ui/views/ime/input_method_bridge.cc
index cb7860e8eab28f1d9283b128cefdde9d1adab92a..88ceec7d5c90938ecc4a40d6ef8a880878370f25 100644
--- a/ui/views/ime/input_method_bridge.cc
+++ b/ui/views/ime/input_method_bridge.cc
@@ -81,7 +81,8 @@ InputMethodBridge::~InputMethodBridge() {
}
void InputMethodBridge::OnFocus() {
- DCHECK(host_);
+ if (!host_) // |host_| could be NULL after OnInputMethodDestroyed.
+ return;
// Direct the shared IME to send TextInputClient messages to |this| object.
if (shared_input_method_ || !host_->GetTextInputClient())
@@ -96,7 +97,8 @@ void InputMethodBridge::OnFocus() {
}
void InputMethodBridge::OnBlur() {
- DCHECK(host_);
+ if (!host_) // |host_| could be NULL after OnInputMethodDestroyed.
+ return;
if (HasCompositionText()) {
ConfirmCompositionText();

Powered by Google App Engine
This is Rietveld 408576698