From 313cba10df7d5f9c194276b4584215e7e49fcaaf Mon Sep 17 00:00:00 2001 From: "yusukes@chromium.org" Date: Sat, 18 Feb 2012 01:26:30 +0000 Subject: Do not consume a translated key event in PartialScreenshotEventFilter. Since the filter has higher priority than the IME filter, it has a change to process both ET_KEY_PRESSED/RELEASED and ET_TRANSLATED_KEY_PRESS/RELEASE event. However, I don't think the filter should consume the latter ones. BUG=108763 TEST=None Review URL: http://codereview.chromium.org/9414011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122656 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/wm/partial_screenshot_event_filter.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ash') diff --git a/ash/wm/partial_screenshot_event_filter.cc b/ash/wm/partial_screenshot_event_filter.cc index c3632e9..ce21e00 100644 --- a/ash/wm/partial_screenshot_event_filter.cc +++ b/ash/wm/partial_screenshot_event_filter.cc @@ -22,6 +22,15 @@ bool PartialScreenshotEventFilter::PreHandleKeyEvent( if (!view_) return false; + // Do not consume a translated key event which is generated by an IME (e.g., + // ui::VKEY_PROCESSKEY) since the key event is generated in response to a key + // press or release before showing the screenshot view. This is important not + // to confuse key event handling JavaScript code in a page. + if (event->type() == ui::ET_TRANSLATED_KEY_PRESS || + event->type() == ui::ET_TRANSLATED_KEY_RELEASE) { + return false; + } + if (event->key_code() == ui::VKEY_ESCAPE) view_->Cancel(); -- cgit v1.1