summaryrefslogtreecommitdiffstats
path: root/ui/views/linux_ui/linux_ui.cc
diff options
context:
space:
mode:
authoryukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 17:48:28 +0000
committeryukishiino@chromium.org <yukishiino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 17:48:28 +0000
commit59cd28095f835828dac26ec612ccf8ba3cc91d94 (patch)
treeedb7d6422fc9ed390d971d048bddeba800b4acd8 /ui/views/linux_ui/linux_ui.cc
parent5e81f89f6fc228016212bedba35a62d067f742ea (diff)
downloadchromium_src-59cd28095f835828dac26ec612ccf8ba3cc91d94.zip
chromium_src-59cd28095f835828dac26ec612ccf8ba3cc91d94.tar.gz
chromium_src-59cd28095f835828dac26ec612ccf8ba3cc91d94.tar.bz2
Implements ui::InputMethodLinuxX11 which is a IME bridge from/to gtk-immodule. This class makes it possible that a non-GTK+-based program (i.e. Linux Aura) communicates with IMEs through gtk-immodule.
The basic approach of this CL is: 1. Translate a XKeyEvent to a GdkEventKey. 2. Send the GDK event to IMEs through gtk-immodule. 3. Pass results to a ui::TextInputClient. I understand that a key concept of Aura is to get rid of platform-dependent GUI framework such as GTK+. However, gtk-immodule is not necessarily GUI framework, and it manages a tons of IMEs gracefully. So I think it's acceptable and worth using gtk-immodule. Most of implementation is quite simple, but this CL includes the following non-trivial hacks. a. Environmental variable IBUS_ENABLE_SYNC_MODE is set to true. The reason is described as a comment in chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc b. This CL renames ui/base/gtk/gtk_im_context_util.{cc,h} to ui/base/ime/composition_text_util_pango.{cc,h}. ui::InputMethodGtkImModule uses ui::ExtractCompositionTextFromGtkPreedit() utility function in the file. However, if toolkit_uses_gtk==0 in gyp, files starting with "gtk_" or in "gtk" directory are removed from build targets (see build/filename_rules.gypi). So I had to move and rename the files, so they're not in "gtk" directory or starting with "gtk_". My justification for this renaming is that the utility function does not directly depend on GTK+. The function compiles without a GTK library. So I think this is okay. BUG=133476 TEST=Done manually. Review URL: https://codereview.chromium.org/25880002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/linux_ui/linux_ui.cc')
-rw-r--r--ui/views/linux_ui/linux_ui.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/views/linux_ui/linux_ui.cc b/ui/views/linux_ui/linux_ui.cc
index 79f0a40..6aa737a 100644
--- a/ui/views/linux_ui/linux_ui.cc
+++ b/ui/views/linux_ui/linux_ui.cc
@@ -4,6 +4,7 @@
#include "ui/views/linux_ui/linux_ui.h"
+#include "ui/base/ime/linux/linux_input_method_context_factory.h"
#include "ui/shell_dialogs/linux_shell_dialog.h"
namespace {
@@ -18,6 +19,7 @@ void LinuxUI::SetInstance(LinuxUI* instance) {
delete g_linux_ui;
g_linux_ui = instance;
+ LinuxInputMethodContextFactory::SetInstance(instance);
LinuxShellDialog::SetInstance(instance);
}