diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 21:31:14 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 21:31:14 +0000 |
commit | 3642e2dc31e87fb1445f586acd8707732042bdf2 (patch) | |
tree | af4d1cde442983b5fa812241833514169ff950eb /chrome/browser/ui/browser_command_controller.cc | |
parent | 950dcc7ef6f3295642bf69ebc9f363fbcfcfdd7f (diff) | |
download | chromium_src-3642e2dc31e87fb1445f586acd8707732042bdf2.zip chromium_src-3642e2dc31e87fb1445f586acd8707732042bdf2.tar.gz chromium_src-3642e2dc31e87fb1445f586acd8707732042bdf2.tar.bz2 |
Stop reserving Shift+F3 (IDC_RELOAD_IGNORING_CACHE), Control+F3 (IDC_RELOAD_IGNORING_CACHE), Shift+F4 (IDC_FULLSCREEN), and IDC_SEARCH since we have no reason to do so.
Along with that, rename browser_unittest.cc to browser_command_controller_unittest.cc and add some test cases.
BUG=152265
TEST=new tests added
Review URL: https://chromiumcodereview.appspot.com/11270024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164739 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 | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index aa6821c..ae7c6db 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -209,18 +209,14 @@ bool BrowserCommandController::IsReservedCommandOrKey( return false; #if defined(OS_CHROMEOS) - // Chrome OS's top row of keys produces F1-10. Make sure that web pages - // aren't able to block Chrome from performing the standard actions for F1-F4. - // We should not handle F5-10 here since they are processed by Ash. See also: - // crbug.com/127333#c8 + // 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. ui::KeyboardCode key_code = - static_cast<ui::KeyboardCode>(event.windowsKeyCode); - if ((key_code == ui::VKEY_F1 || - key_code == ui::VKEY_F2 || - key_code == ui::VKEY_F3 || - key_code == ui::VKEY_F4) && - // Make sure it's a browser shortcut (i.e. not an Ash one like Alt+F4). - command_id != -1) { + 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)) { return true; } #endif @@ -236,8 +232,7 @@ bool BrowserCommandController::IsReservedCommandOrKey( command_id == IDC_SELECT_NEXT_TAB || command_id == IDC_SELECT_PREVIOUS_TAB || command_id == IDC_TABPOSE || - command_id == IDC_EXIT || - command_id == IDC_SEARCH; + command_id == IDC_EXIT; } void BrowserCommandController::SetBlockCommandExecution(bool block) { |