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 7d5629a519f0b6593279f26618810a7ef8c56a7f..6d9224ac6fc926ec63b86b73948088d1190fa97e 100644 |
--- a/ui/views/widget/native_widget_aura.cc |
+++ b/ui/views/widget/native_widget_aura.cc |
@@ -21,6 +21,7 @@ |
#include "ui/gfx/compositor/layer.h" |
#include "ui/gfx/font.h" |
#include "ui/gfx/screen.h" |
+#include "ui/views/ime/input_method_bridge.h" |
#include "ui/views/widget/drop_helper.h" |
#include "ui/views/widget/native_widget_delegate.h" |
#include "ui/views/widget/tooltip_manager_aura.h" |
@@ -32,12 +33,6 @@ |
#include "ui/base/l10n/l10n_util_win.h" |
#endif |
-#if defined(HAVE_IBUS) |
-#include "ui/views/ime/input_method_ibus.h" |
-#else |
-#include "ui/views/ime/mock_input_method.h" |
-#endif |
- |
namespace views { |
namespace { |
@@ -300,11 +295,10 @@ bool NativeWidgetAura::HasMouseCapture() const { |
} |
InputMethod* NativeWidgetAura::CreateInputMethod() { |
-#if defined(HAVE_IBUS) |
- InputMethod* input_method = new InputMethodIBus(this); |
-#else |
- InputMethod* input_method = new MockInputMethod(this); |
-#endif |
+ aura::RootWindow* root_window = aura::RootWindow::GetInstance(); |
+ ui::InputMethod* host = reinterpret_cast<ui::InputMethod*>( |
+ root_window->GetProperty(aura::kRootWindowInputMethod)); |
+ InputMethod* input_method = new InputMethodBridge(this, host); |
input_method->Init(GetWidget()); |
return input_method; |
} |
@@ -628,15 +622,14 @@ 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. |
+ // TODO(yusukes): Need an ui::InputMethod to properly handle character events. |
+ // Right now, we just skip these. |
if (event->is_char()) |
return false; |
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; |