OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser_command_controller.h" | 5 #include "chrome/browser/ui/browser_command_controller.h" |
6 | 6 |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 bool BrowserCommandController::IsReservedCommandOrKey( | 129 bool BrowserCommandController::IsReservedCommandOrKey( |
130 int command_id, | 130 int command_id, |
131 const content::NativeWebKeyboardEvent& event) { | 131 const content::NativeWebKeyboardEvent& event) { |
132 // In Apps mode, no keys are reserved. | 132 // In Apps mode, no keys are reserved. |
133 if (browser_->is_app()) | 133 if (browser_->is_app()) |
134 return false; | 134 return false; |
135 | 135 |
136 #if defined(OS_CHROMEOS) | 136 #if defined(OS_CHROMEOS) |
137 // Chrome OS's top row of keys produces F1-10. Make sure that web pages | 137 // Chrome OS's top row of keys produces F1-10. Make sure that web pages |
138 // aren't able to block Chrome from performing the standard actions for F1-F4. | 138 // aren't able to block Chrome from performing the standard actions for F1-F4. |
139 // We should not handle F5-10 here since they are processed by Ash. See also: | 139 // We should not handle F4-10 here since they are processed by Ash. See also: |
140 // crbug.com/127333#c8 | 140 // crbug.com/127333#c8 |
| 141 // crbug.com/145402 for removing VKEY_F4 |
141 ui::KeyboardCode key_code = | 142 ui::KeyboardCode key_code = |
142 static_cast<ui::KeyboardCode>(event.windowsKeyCode); | 143 static_cast<ui::KeyboardCode>(event.windowsKeyCode); |
143 if ((key_code == ui::VKEY_F1 || | 144 if ((key_code == ui::VKEY_F1 || |
144 key_code == ui::VKEY_F2 || | 145 key_code == ui::VKEY_F2 || |
145 key_code == ui::VKEY_F3 || | 146 key_code == ui::VKEY_F3) && |
146 key_code == ui::VKEY_F4) && | |
147 // Make sure it's a browser shortcut (i.e. not an Ash one like Alt+F4). | 147 // Make sure it's a browser shortcut (i.e. not an Ash one like Alt+F4). |
148 command_id != -1) { | 148 command_id != -1) { |
149 return true; | 149 return true; |
150 } | 150 } |
151 #endif | 151 #endif |
152 | 152 |
153 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) | 153 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) |
154 return true; | 154 return true; |
155 return command_id == IDC_CLOSE_TAB || | 155 return command_id == IDC_CLOSE_TAB || |
156 command_id == IDC_CLOSE_WINDOW || | 156 command_id == IDC_CLOSE_WINDOW || |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 | 1095 |
1096 BrowserWindow* BrowserCommandController::window() { | 1096 BrowserWindow* BrowserCommandController::window() { |
1097 return browser_->window(); | 1097 return browser_->window(); |
1098 } | 1098 } |
1099 | 1099 |
1100 Profile* BrowserCommandController::profile() { | 1100 Profile* BrowserCommandController::profile() { |
1101 return browser_->profile(); | 1101 return browser_->profile(); |
1102 } | 1102 } |
1103 | 1103 |
1104 } // namespace chrome | 1104 } // namespace chrome |
OLD | NEW |