Index: views/widget/native_widget_aura.cc |
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc |
index 88e3013c86eb5b19482a89392eca08bda8ceb3ac..2f018f5ee37012647bede0f6e7ede1b2d394a9e1 100644 |
--- a/views/widget/native_widget_aura.cc |
+++ b/views/widget/native_widget_aura.cc |
@@ -26,7 +26,7 @@ |
#endif |
#if defined(HAVE_IBUS) |
James Su
2011/11/21 08:23:36
do we still need this check?
Yusuke Sato
2011/11/22 11:09:30
If we use InputMethodBridge here, views_unittests
|
-#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 |
@@ -264,8 +264,10 @@ bool NativeWidgetAura::HasMouseCapture() const { |
InputMethod* NativeWidgetAura::CreateInputMethod() { |
#if defined(HAVE_IBUS) |
James Su
2011/11/21 08:23:36
Do we still need this check?
Yusuke Sato
2011/11/22 11:09:30
ditto.
|
- 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()); |
@@ -559,15 +561,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; |