summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 04:14:13 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-29 04:14:13 +0000
commit2a09804d47f363ec9e857d31bb4cf4593303c360 (patch)
tree22326dc7f95dde729c0d1692c7c9ea6b62c836bd /ui
parentcb1cc2c4d1fcf6d928d484bd766a312d9924a57b (diff)
downloadchromium_src-2a09804d47f363ec9e857d31bb4cf4593303c360.zip
chromium_src-2a09804d47f363ec9e857d31bb4cf4593303c360.tar.gz
chromium_src-2a09804d47f363ec9e857d31bb4cf4593303c360.tar.bz2
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
Diffstat (limited to 'ui')
-rw-r--r--ui/base/ime/fake_input_method.cc9
-rw-r--r--ui/base/ime/input_method_factory.cc4
2 files changed, 10 insertions, 3 deletions
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);