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

Unified Diff: views/ime/input_method_ibus.cc

Issue 7004029: Fix to make InputMethodIBus usable on every ChromeOS device (even without TouchUI) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small fix to replace "if" with "?" Created 9 years, 7 months 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 | « views/ime/input_method_ibus.h ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/ime/input_method_ibus.cc
diff --git a/views/ime/input_method_ibus.cc b/views/ime/input_method_ibus.cc
index a20e05a2ffe2839e40ffb4bbc291be62faf72b78..c8d72511e0a845e35313991479e2121ca6d6b815 100644
--- a/views/ime/input_method_ibus.cc
+++ b/views/ime/input_method_ibus.cc
@@ -14,6 +14,7 @@
#include <X11/Xutil.h>
#endif
+#include "base/command_line.h"
#include "base/basictypes.h"
#include "base/i18n/char_iterator.h"
#include "base/logging.h"
@@ -31,6 +32,9 @@
namespace {
+// A global flag to switch the InputMethod implementation to InputMethodIBus
+bool inputmethod_ibus_enabled = false;
+
// Converts ibus key state flags to Views event flags.
int ViewsFlagsFromIBusState(guint32 state) {
return (state & IBUS_LOCK_MASK ? ui::EF_CAPS_LOCK_DOWN : 0) |
@@ -126,6 +130,9 @@ void ExtractCompositionTextFromIBusPreedit(IBusText* text,
}
}
+// A switch to enable InputMethodIBus
+const char kEnableInputMethodIBusSwitch[] = "enable-inputmethod-ibus";
+
} // namespace
namespace views {
@@ -409,6 +416,22 @@ bool InputMethodIBus::IsActive() {
return context_ != NULL;
}
+// static
+bool InputMethodIBus::IsInputMethodIBusEnabled() {
+#if defined(TOUCH_UI)
+ return true;
+#else
+ return inputmethod_ibus_enabled ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ kEnableInputMethodIBusSwitch);
+#endif
+}
+
+// static
+void InputMethodIBus::SetEnableInputMethodIBus(bool enabled) {
+ inputmethod_ibus_enabled = enabled;
+}
+
void InputMethodIBus::FocusedViewWillChange() {
ConfirmCompositionText();
}
« no previous file with comments | « views/ime/input_method_ibus.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698