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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 #if defined(OS_CHROMEOS) | 62 #if defined(OS_CHROMEOS) |
63 #include "ash/multi_profile_uma.h" | 63 #include "ash/multi_profile_uma.h" |
64 #include "ash/session_state_delegate.h" | 64 #include "ash/session_state_delegate.h" |
65 #include "ash/shell.h" | 65 #include "ash/shell.h" |
66 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" | 66 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" |
67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
68 #include "chrome/browser/ui/browser_commands_chromeos.h" | 68 #include "chrome/browser/ui/browser_commands_chromeos.h" |
69 #endif | 69 #endif |
70 | 70 |
| 71 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 72 #include "ui/events/x/text_edit_key_bindings_delegate_x11.h" |
| 73 #endif |
| 74 |
71 using content::NavigationEntry; | 75 using content::NavigationEntry; |
72 using content::NavigationController; | 76 using content::NavigationController; |
73 using content::WebContents; | 77 using content::WebContents; |
74 | 78 |
75 namespace { | 79 namespace { |
76 | 80 |
77 enum WindowState { | 81 enum WindowState { |
78 // Not in fullscreen mode. | 82 // Not in fullscreen mode. |
79 WINDOW_STATE_NOT_FULLSCREEN, | 83 WINDOW_STATE_NOT_FULLSCREEN, |
80 | 84 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 static_cast<ui::KeyboardCode>(event.windowsKeyCode); | 279 static_cast<ui::KeyboardCode>(event.windowsKeyCode); |
276 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || | 280 if ((key_code == ui::VKEY_BROWSER_BACK && command_id == IDC_BACK) || |
277 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || | 281 (key_code == ui::VKEY_BROWSER_FORWARD && command_id == IDC_FORWARD) || |
278 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { | 282 (key_code == ui::VKEY_BROWSER_REFRESH && command_id == IDC_RELOAD)) { |
279 return true; | 283 return true; |
280 } | 284 } |
281 #endif | 285 #endif |
282 | 286 |
283 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) | 287 if (window()->IsFullscreen() && command_id == IDC_FULLSCREEN) |
284 return true; | 288 return true; |
| 289 |
| 290 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_GTK) |
| 291 // If this key was registered by the user as a content editing hotkey, then |
| 292 // it is not reserved. |
| 293 ui::TextEditKeyBindingsDelegateX11* delegate = |
| 294 ui::GetTextEditKeyBindingsDelegate(); |
| 295 if (delegate && delegate->MatchEvent(*event.os_event, NULL)) |
| 296 return false; |
| 297 #endif |
| 298 |
285 return command_id == IDC_CLOSE_TAB || | 299 return command_id == IDC_CLOSE_TAB || |
286 command_id == IDC_CLOSE_WINDOW || | 300 command_id == IDC_CLOSE_WINDOW || |
287 command_id == IDC_NEW_INCOGNITO_WINDOW || | 301 command_id == IDC_NEW_INCOGNITO_WINDOW || |
288 command_id == IDC_NEW_TAB || | 302 command_id == IDC_NEW_TAB || |
289 command_id == IDC_NEW_WINDOW || | 303 command_id == IDC_NEW_WINDOW || |
290 command_id == IDC_RESTORE_TAB || | 304 command_id == IDC_RESTORE_TAB || |
291 command_id == IDC_SELECT_NEXT_TAB || | 305 command_id == IDC_SELECT_NEXT_TAB || |
292 command_id == IDC_SELECT_PREVIOUS_TAB || | 306 command_id == IDC_SELECT_PREVIOUS_TAB || |
293 command_id == IDC_EXIT; | 307 command_id == IDC_EXIT; |
294 } | 308 } |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 | 1365 |
1352 BrowserWindow* BrowserCommandController::window() { | 1366 BrowserWindow* BrowserCommandController::window() { |
1353 return browser_->window(); | 1367 return browser_->window(); |
1354 } | 1368 } |
1355 | 1369 |
1356 Profile* BrowserCommandController::profile() { | 1370 Profile* BrowserCommandController::profile() { |
1357 return browser_->profile(); | 1371 return browser_->profile(); |
1358 } | 1372 } |
1359 | 1373 |
1360 } // namespace chrome | 1374 } // namespace chrome |
OLD | NEW |