summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 17:44:21 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-09 17:44:21 +0000
commit0618142e885d436f74be533ecf6e9bb4d4155ba0 (patch)
tree168fff09d193dccb015787ea1c55a1aa37107be1 /chrome/browser/ui/cocoa/browser_window_cocoa.mm
parent7bd42fc327785653c626fe23b6f24988381e8264 (diff)
downloadchromium_src-0618142e885d436f74be533ecf6e9bb4d4155ba0.zip
chromium_src-0618142e885d436f74be533ecf6e9bb4d4155ba0.tar.gz
chromium_src-0618142e885d436f74be533ecf6e9bb4d4155ba0.tar.bz2
chromeos: Don't let pages intercept top-row keys.
This prevents keys F1 through F10 on Chrome OS devices (Back, Forward, Reload, and Fullscreen plus friends) from getting intercepted by web pages. These keys are explicitly labeled with icons for these functions, so it seems reasonable for users to expect that they'll work at all times. BUG=chromium-os:9605 TEST=went to a plexode page that had a "return false" handler for onkey{down,press,up} and checked that the top-row keys worked as intended Review URL: http://codereview.chromium.org/6312170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/browser_window_cocoa.mm')
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 0a75366..3594d03 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -436,7 +436,7 @@ bool BrowserWindowCocoa::PreHandleKeyboardEvent(
if (id == -1)
return false;
- if (browser_->IsReservedCommand(id))
+ if (browser_->IsReservedCommandOrKey(id, event))
return HandleKeyboardEventInternal(event.os_event);
DCHECK(is_keyboard_shortcut != NULL);
@@ -495,7 +495,7 @@ int BrowserWindowCocoa::GetCommandId(const NativeWebKeyboardEvent& event) {
// "Close window" doesn't use the |commandDispatch:| mechanism. Menu items
// that do not correspond to IDC_ constants need no special treatment however,
- // as they can't be blacklisted in |Browser::IsReservedCommand()| anyhow.
+ // as they can't be blacklisted in |Browser::IsReservedCommandOrKey()| anyhow.
if (item && [item action] == @selector(performClose:))
return IDC_CLOSE_WINDOW;