Index: ui/views/widget/native_widget_aura.cc |
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc |
index bcb14a7d6b89cb5c96a571735034fa902edebcff..16c71a03304b112744843edbe6ac45dea4e7a5fd 100644 |
--- a/ui/views/widget/native_widget_aura.cc |
+++ b/ui/views/widget/native_widget_aura.cc |
@@ -31,7 +31,7 @@ |
#endif |
#if defined(HAVE_IBUS) |
-#include "ui/views/ime/input_method_ibus.h" |
+#include "ui/views/ime/input_method_bridge.h" |
#else |
#include "ui/views/ime/mock_input_method.h" |
#endif |
@@ -279,8 +279,10 @@ bool NativeWidgetAura::HasMouseCapture() const { |
InputMethod* NativeWidgetAura::CreateInputMethod() { |
#if defined(HAVE_IBUS) |
- InputMethod* input_method = new InputMethodIBus(this); |
+ ui::InputMethod* host = aura::Desktop::GetInstance()->GetInputMethod(); |
+ InputMethod* input_method = new InputMethodBridge(this, host); |
#else |
+ // Use the mock IME for unit tests. |
InputMethod* input_method = new MockInputMethod(this); |
#endif |
input_method->Init(GetWidget()); |
@@ -572,15 +574,10 @@ void NativeWidgetAura::OnBlur() { |
} |
bool NativeWidgetAura::OnKeyEvent(aura::KeyEvent* event) { |
- // TODO(beng): Need an InputMethodAura to properly handle character events. |
- // Right now, we just skip these. |
- if (event->is_char()) |
- return false; |
- |
+ DCHECK(!event->is_char()); |
DCHECK(window_->IsVisible()); |
InputMethod* input_method = GetWidget()->GetInputMethod(); |
DCHECK(input_method); |
- // TODO(oshima): DispatchKeyEvent should return bool? |
KeyEvent views_event(event); |
input_method->DispatchKeyEvent(views_event); |
return true; |