From 2a09804d47f363ec9e857d31bb4cf4593303c360 Mon Sep 17 00:00:00 2001 From: "sadrul@chromium.org" Date: Fri, 29 Mar 2013 04:14:13 +0000 Subject: ime: Use ibus IME only when X11 is available. If X11 is not available, then use the fake IME. BUG=none Review URL: https://codereview.chromium.org/13182002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191292 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/base/ime/fake_input_method.cc | 9 ++++++++- ui/base/ime/input_method_factory.cc | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/base/ime/fake_input_method.cc b/ui/base/ime/fake_input_method.cc index 69ebdd1..8e350b6 100644 --- a/ui/base/ime/fake_input_method.cc +++ b/ui/base/ime/fake_input_method.cc @@ -98,7 +98,14 @@ bool FakeInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) { } bool FakeInputMethod::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { - return false; + bool handled = delegate_->DispatchFabricatedKeyEventPostIME( + event.type(), event.key_code(), event.flags()); + if (event.type() == ET_KEY_PRESSED && text_input_client_) { + uint16 ch = event.GetCharacter(); + if (ch) + text_input_client_->InsertChar(ch, event.flags()); + } + return handled; } void FakeInputMethod::Init(bool focused) {} diff --git a/ui/base/ime/input_method_factory.cc b/ui/base/ime/input_method_factory.cc index ec97bbe..20fd39c 100644 --- a/ui/base/ime/input_method_factory.cc +++ b/ui/base/ime/input_method_factory.cc @@ -7,7 +7,7 @@ #include "ui/base/ime/input_method_delegate.h" #include "ui/base/ime/mock_input_method.h" -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) && defined(USE_X11) #include "ui/base/ime/input_method_ibus.h" #elif defined(OS_WIN) #include "ui/base/ime/input_method_win.h" @@ -25,7 +25,7 @@ InputMethod* CreateInputMethod(internal::InputMethodDelegate* delegate, gfx::AcceleratedWidget widget) { if (g_input_method_set_for_testing) return new MockInputMethod(delegate); -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) && defined(USE_X11) return new InputMethodIBus(delegate); #elif defined(OS_WIN) return new InputMethodWin(delegate, widget); -- cgit v1.1