summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 03:13:31 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 03:13:31 +0000
commit3ae1feb620daffbdf65d4b11038268da2e14090e (patch)
treed496395a3a932cd83618c9ee9c68e0f5113b8f13 /chrome/browser/renderer_host
parent034b3c6d0acaed4260b255c24a853bd92fd7e4df (diff)
downloadchromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.zip
chromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.tar.gz
chromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.tar.bz2
Make backspace not go back while IME is active.
Linux does this in GtkIMContextWrapper::ProcessFilteredKeyPressEvent() by setting hardware_keycode to 0. It's a pain to change an NSEvent, so I just added a bool "skip" to NativeWebKeybordEvent and set it to "true" for rawkeydowns while ime is active. BUG=25000 TEST=Open webpage. Focus text field. Type something, hit backspace. Text should be deleted. Focus background, hit backspace. Browser should go back one page. Focus text field, start IME (either by going to syspref->international->input menu and enabling e.g. "Kotoeri" and then selecting this in the top right corner and typing a single "a", or by just activating dead key ime on an us layout by hitting opt-u, opt-i, or opt-e), hit backspace. Browser should not go back but end IME mode. Review URL: http://codereview.chromium.org/295003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 4a05273..f19243b 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -588,8 +588,11 @@ void RenderWidgetHostViewMac::SetBackground(const SkBitmap& background) {
// while an input method is composing a text.
// Gmail checks this code in its onkeydown handler to stop auto-completing
// e-mail addresses while composing a CJK text.
- if ([theEvent type] == NSKeyDown && renderWidgetHostView_->im_composing_)
- event.windowsKeyCode = 0xE5;
+ if ([theEvent type] == NSKeyDown && renderWidgetHostView_->im_composing_) {
+ event.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
+ event.setKeyIdentifierFromWindowsKeyCode();
+ event.skip_in_browser = true;
+ }
// Dispatch this keyboard event to the renderer.
if (renderWidgetHostView_->render_widget_host_) {