Index: ui/aura/window_tree_host.cc |
diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc |
index 892635705595c75b979ef8476fdf5fe2a5959ccd..15d004042920bd41e20366da9650a97dcc792171 100644 |
--- a/ui/aura/window_tree_host.cc |
+++ b/ui/aura/window_tree_host.cc |
@@ -194,7 +194,13 @@ void WindowTreeHost::SetSharedInputMethod(ui::InputMethod* input_method) { |
ui::EventDispatchDetails WindowTreeHost::DispatchKeyEventPostIME( |
ui::KeyEvent* event) { |
- return SendEventToSink(event); |
+ // If dispatch to IME is already disabled we shouldn't reach here. |
+ DCHECK(!dispatcher_->should_skip_ime()); |
+ dispatcher_->set_skip_ime(true); |
+ ui::EventDispatchDetails dispatch_details = SendEventToSink(event); |
+ if (!dispatch_details.dispatcher_destroyed) |
+ dispatcher_->set_skip_ime(false); |
+ return dispatch_details; |
} |
void WindowTreeHost::Show() { |