Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 // reserve browser back/forward and refresh here. | 192 // reserve browser back/forward and refresh here. |
| 193 ui::KeyboardCode key_code = | 193 ui::KeyboardCode key_code = |
| 194 static_cast<ui::KeyboardCode>(event.windowsKeyCode); | 194 static_cast<ui::KeyboardCode>(event.windowsKeyCode); |
| 195 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || | 195 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || |
| 196 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || | 196 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || |
| 197 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { | 197 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { |
| 198 return true; | 198 return true; |
| 199 } | 199 } |
| 200 #endif | 200 #endif |
| 201 | 201 |
| 202 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) | 202 if (window()->IsFullscreen()) { |
| 203 return true; | 203 // In full-screen mode, all the keys, except for F11, should be delivered to |
| 204 // the web page. This has been discussed in the document Allowing sites to | |
|
dominickn
2017/01/16 22:13:39
Since this is a web-facing change, this cannot be
Hzj_jie
2017/01/17 23:19:10
I have received the intent of implementation from
| |
| 205 // intercept keyboard shortcuts at https://goo.gl/r6XmNt. | |
| 206 return command_id == IDC_FULLSCREEN; | |
| 207 } | |
| 204 | 208 |
| 205 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 209 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 206 // If this key was registered by the user as a content editing hotkey, then | 210 // If this key was registered by the user as a content editing hotkey, then |
| 207 // it is not reserved. | 211 // it is not reserved. |
| 208 ui::TextEditKeyBindingsDelegateAuraLinux* delegate = | 212 ui::TextEditKeyBindingsDelegateAuraLinux* delegate = |
| 209 ui::GetTextEditKeyBindingsDelegate(); | 213 ui::GetTextEditKeyBindingsDelegate(); |
| 210 if (delegate && event.os_event && delegate->MatchEvent(*event.os_event, NULL)) | 214 if (delegate && event.os_event && delegate->MatchEvent(*event.os_event, NULL)) |
| 211 return false; | 215 return false; |
| 212 #endif | 216 #endif |
| 213 | 217 |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1173 | 1177 |
| 1174 BrowserWindow* BrowserCommandController::window() { | 1178 BrowserWindow* BrowserCommandController::window() { |
| 1175 return browser_->window(); | 1179 return browser_->window(); |
| 1176 } | 1180 } |
| 1177 | 1181 |
| 1178 Profile* BrowserCommandController::profile() { | 1182 Profile* BrowserCommandController::profile() { |
| 1179 return browser_->profile(); | 1183 return browser_->profile(); |
| 1180 } | 1184 } |
| 1181 | 1185 |
| 1182 } // namespace chrome | 1186 } // namespace chrome |
| OLD | NEW |