Index: ui/keyboard/keyboard_util.cc |
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc |
index 00b9f9e99d779d17319039c4fea5c0f638da0fca..b77d972fbf22937d14e0878b764ff8dccef6d524 100644 |
--- a/ui/keyboard/keyboard_util.cc |
+++ b/ui/keyboard/keyboard_util.cc |
@@ -14,7 +14,6 @@ |
#include "base/strings/string16.h" |
#include "grit/keyboard_resources.h" |
#include "grit/keyboard_resources_map.h" |
-#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/window_tree_host.h" |
#include "ui/base/ime/input_method.h" |
#include "ui/base/ime/text_input_client.h" |
@@ -38,7 +37,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 +282,11 @@ bool SendKeyEvent(const std::string type, |
ui::KeyboardCode code = static_cast<ui::KeyboardCode>(key_code); |
+ ui::InputMethod* input_method = host->GetInputMethod(); |
sky
2015/06/04 13:40:28
How about moving this to where it's needed, eg 326
Shu Chen
2015/06/04 15:59:26
line 293 also needs it.
|
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 +323,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; |
} |