Index: ui/keyboard/keyboard_util.cc |
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc |
index 00b9f9e99d779d17319039c4fea5c0f638da0fca..25e7d42b69f8c49d76da4713b0a2fb38898fcc25 100644 |
--- a/ui/keyboard/keyboard_util.cc |
+++ b/ui/keyboard/keyboard_util.cc |
@@ -38,7 +38,6 @@ void SendProcessKeyEvent(ui::EventType type, |
aura::WindowTreeHost* host) { |
ui::KeyEvent event(type, ui::VKEY_PROCESSKEY, ui::DomCode::NONE, ui::EF_NONE, |
ui::DomKey::PROCESS, 0, ui::EventTimeForNow()); |
- event.SetTranslated(true); |
ui::EventDispatchDetails details = |
host->event_processor()->OnEventFromSource(&event); |
CHECK(!details.dispatcher_destroyed); |
@@ -284,12 +283,11 @@ bool SendKeyEvent(const std::string type, |
ui::KeyboardCode code = static_cast<ui::KeyboardCode>(key_code); |
+ ui::InputMethod* input_method = host->GetInputMethod(); |
if (code == ui::VKEY_UNKNOWN) { |
// Handling of special printable characters (e.g. accented characters) for |
// which there is no key code. |
if (event_type == ui::ET_KEY_RELEASED) { |
- ui::InputMethod* input_method = host->window()->GetProperty( |
- aura::client::kRootWindowInputMethodKey); |
if (!input_method) |
return false; |
@@ -326,9 +324,13 @@ bool SendKeyEvent(const std::string type, |
code, |
dom_code, |
modifiers); |
- ui::EventDispatchDetails details = |
- host->event_processor()->OnEventFromSource(&event); |
- CHECK(!details.dispatcher_destroyed); |
+ if (input_method) { |
+ input_method->DispatchKeyEvent(event); |
+ } else { |
+ ui::EventDispatchDetails details = |
+ host->event_processor()->OnEventFromSource(&event); |
+ CHECK(!details.dispatcher_destroyed); |
+ } |
} |
return true; |
} |