diff options
author | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-21 05:44:19 +0000 |
---|---|---|
committer | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-21 05:44:19 +0000 |
commit | 397abd3643aa89424d75c051c411d6b705ed5a1c (patch) | |
tree | 031c368c244c3ca9173ae483b8f967c4398311f5 /chrome/browser/ui/browser_command_controller.cc | |
parent | d7a2ffe04650c2a0f1317fd41ca8114a4a5dbe2a (diff) | |
download | chromium_src-397abd3643aa89424d75c051c411d6b705ed5a1c.zip chromium_src-397abd3643aa89424d75c051c411d6b705ed5a1c.tar.gz chromium_src-397abd3643aa89424d75c051c411d6b705ed5a1c.tar.bz2 |
Making back/forward/refresh keys as reserved key.
The keys in first row are no longer assigned to F1-F10.
BUG=276201
TEST=manually checked that event.preventDefault() can't cancel page refresh.
Review URL: https://chromiumcodereview.appspot.com/23172009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_command_controller.cc')
-rw-r--r-- | chrome/browser/ui/browser_command_controller.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 4300e86..16d4f41 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -235,14 +235,15 @@ bool BrowserCommandController::IsReservedCommandOrKey( return false; #if defined(OS_CHROMEOS) - // On Chrome OS, the top row of keys are mapped to F1-F10. We don't want web - // pages to be able to change the behavior of these keys. Ash handles F4 and - // up; this leaves us needing to reserve F1-F3 here. + // On Chrome OS, the top row of keys are mapped to browser actions like + // back/forward or refresh. We don't want web pages to be able to change the + // behavior of these keys. Ash handles F4 and up; this leaves us needing to + // reserve browser back/forward and refresh here. ui::KeyboardCode key_code = static_cast<ui::KeyboardCode>(event.windowsKeyCode); - if ((key_code == ui::VKEY_F1 && command_id == IDC_BACK) || - (key_code == ui::VKEY_F2 && command_id == IDC_FORWARD) || - (key_code == ui::VKEY_F3 && command_id == IDC_RELOAD)) { + if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || + (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || + (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { return true; } #endif |