Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1258)

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moving IME code to aura_shell. not ready for review Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b13182d9624edb7521635cad865df163d09e5349..775e3312c8e6275677c74f315d0606271612a48f 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -32,7 +32,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
@@ -280,8 +280,11 @@ bool NativeWidgetAura::HasMouseCapture() const {
InputMethod* NativeWidgetAura::CreateInputMethod() {
#if defined(HAVE_IBUS)
- InputMethod* input_method = new InputMethodIBus(this);
+ ui::InputMethod* host = aura::RootWindow::GetInstance()->input_method();
+ DCHECK(host);
+ 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());
@@ -573,15 +576,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;
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698