diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:19:53 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-31 00:19:53 +0000 |
commit | 8e8817a36fff169cf3767462717c2321b30fa2af (patch) | |
tree | f45044380c8115de18884942ff87c24cbcb2a551 /webkit | |
parent | 9c4e77ab10f059f1178394da4ae76bce2a4fc9e7 (diff) | |
download | chromium_src-8e8817a36fff169cf3767462717c2321b30fa2af.zip chromium_src-8e8817a36fff169cf3767462717c2321b30fa2af.tar.gz chromium_src-8e8817a36fff169cf3767462717c2321b30fa2af.tar.bz2 |
linux: fix text input in test_shell
Keyboard handling was significantly changed for IMEs to work, and
in the process test_shell was broken. This change is just enough
to get plain ASCII text working again, which is at least useful
for diagnosing e.g. gmail bugs.
BUG=18115
Review URL: http://codereview.chromium.org/159673
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index 46b72e3..0f688b6 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -163,6 +163,19 @@ class WebWidgetHostGtkWidget { WebWidgetHost* host) { host->webwidget()->handleInputEvent( WebInputEventFactory::keyboardEvent(event)); + + // In the browser we do a ton of work with IMEs. This is some minimal + // code to make basic text work in test_shell, but doesn't cover IME. + // This is a copy of the logic in ProcessUnfilteredKeyPressEvent in + // render_widget_host_view_gtk.cc . + if (event->type == GDK_KEY_PRESS) { + WebKeyboardEvent wke = WebInputEventFactory::keyboardEvent(event); + if (wke.text[0]) { + wke.type = WebKit::WebInputEvent::Char; + host->webwidget()->handleInputEvent(wke); + } + } + return FALSE; } |