summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 13:07:45 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 13:07:45 +0000
commit328653c2e32b570d8cdbef3938b8b834f3b5abfb (patch)
treeae18f3e84a477f9de1f49e53cd5d25f2c1253f1e /chrome
parent73cb4b07021be752288588d06978a2be0bb818f9 (diff)
downloadchromium_src-328653c2e32b570d8cdbef3938b8b834f3b5abfb.zip
chromium_src-328653c2e32b570d8cdbef3938b8b834f3b5abfb.tar.gz
chromium_src-328653c2e32b570d8cdbef3938b8b834f3b5abfb.tar.bz2
[Linux] Don't send a key event to browser window for pre-handling if it's handled by IME.
BUG=53397 BUG=chromium-os:6471 TEST=Manually. See bug report. Review URL: http://codereview.chromium.org/3307020 Patch from James Su <suzhe@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index a4c3d21..4959049 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -492,21 +492,24 @@ void RenderWidgetHost::ForwardKeyboardEvent(
suppress_next_char_events_ = false;
}
- // We need to set |suppress_next_char_events_| to true if
- // PreHandleKeyboardEvent() returns true, but |this| may already be
- // destroyed at that time. So set |suppress_next_char_events_| true here,
- // then revert it afterwards when necessary.
- if (key_event.type == WebKeyboardEvent::RawKeyDown)
- suppress_next_char_events_ = true;
-
bool is_keyboard_shortcut = false;
- // Tab switching/closing accelerators aren't sent to the renderer to avoid a
- // hung/malicious renderer from interfering.
- if (PreHandleKeyboardEvent(key_event, &is_keyboard_shortcut))
- return;
+ // Only pre-handle the key event if it's not handled by the input method.
+ if (!key_event.skip_in_browser) {
+ // We need to set |suppress_next_char_events_| to true if
+ // PreHandleKeyboardEvent() returns true, but |this| may already be
+ // destroyed at that time. So set |suppress_next_char_events_| true here,
+ // then revert it afterwards when necessary.
+ if (key_event.type == WebKeyboardEvent::RawKeyDown)
+ suppress_next_char_events_ = true;
+
+ // Tab switching/closing accelerators aren't sent to the renderer to avoid
+ // a hung/malicious renderer from interfering.
+ if (PreHandleKeyboardEvent(key_event, &is_keyboard_shortcut))
+ return;
- if (key_event.type == WebKeyboardEvent::RawKeyDown)
- suppress_next_char_events_ = false;
+ if (key_event.type == WebKeyboardEvent::RawKeyDown)
+ suppress_next_char_events_ = false;
+ }
// Don't add this key to the queue if we have no way to send the message...
if (!process_->HasConnection())