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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #if defined(USE_ASH) | 57 #if defined(USE_ASH) |
58 #include "ash/accelerators/accelerator_commands.h" | 58 #include "ash/accelerators/accelerator_commands.h" |
59 #include "chrome/browser/ui/ash/ash_util.h" | 59 #include "chrome/browser/ui/ash/ash_util.h" |
60 #endif | 60 #endif |
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_window_manager.h" | 66 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 67 #include "chrome/browser/ui/browser_commands_chromeos.h" |
67 #endif | 68 #endif |
68 | 69 |
69 using content::NavigationEntry; | 70 using content::NavigationEntry; |
70 using content::NavigationController; | 71 using content::NavigationController; |
71 using content::WebContents; | 72 using content::WebContents; |
72 | 73 |
73 namespace { | 74 namespace { |
74 | 75 |
75 enum WindowState { | 76 enum WindowState { |
76 // Not in fullscreen mode. | 77 // Not in fullscreen mode. |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 break; | 680 break; |
680 case IDC_DEV_TOOLS_INSPECT: | 681 case IDC_DEV_TOOLS_INSPECT: |
681 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Inspect()); | 682 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Inspect()); |
682 break; | 683 break; |
683 case IDC_DEV_TOOLS_TOGGLE: | 684 case IDC_DEV_TOOLS_TOGGLE: |
684 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Toggle()); | 685 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Toggle()); |
685 break; | 686 break; |
686 case IDC_TASK_MANAGER: | 687 case IDC_TASK_MANAGER: |
687 OpenTaskManager(browser_); | 688 OpenTaskManager(browser_); |
688 break; | 689 break; |
| 690 #if defined(OS_CHROMEOS) |
| 691 case IDC_TAKE_SCREENSHOT: |
| 692 TakeScreenshot(); |
| 693 break; |
| 694 #endif |
689 #if defined(GOOGLE_CHROME_BUILD) | 695 #if defined(GOOGLE_CHROME_BUILD) |
690 case IDC_FEEDBACK: | 696 case IDC_FEEDBACK: |
691 OpenFeedbackDialog(browser_); | 697 OpenFeedbackDialog(browser_); |
692 break; | 698 break; |
693 #endif | 699 #endif |
694 case IDC_SHOW_BOOKMARK_BAR: | 700 case IDC_SHOW_BOOKMARK_BAR: |
695 ToggleBookmarkBar(browser_); | 701 ToggleBookmarkBar(browser_); |
696 break; | 702 break; |
697 case IDC_PROFILING_ENABLED: | 703 case IDC_PROFILING_ENABLED: |
698 Profiling::Toggle(); | 704 Profiling::Toggle(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, | 961 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, |
956 !profile()->IsGuestSession()); | 962 !profile()->IsGuestSession()); |
957 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | 963 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); |
958 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); | 964 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); |
959 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); | 965 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); |
960 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, | 966 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, |
961 !profile()->IsGuestSession()); | 967 !profile()->IsGuestSession()); |
962 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, | 968 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, |
963 !profile()->IsGuestSession() && | 969 !profile()->IsGuestSession() && |
964 !profile()->IsOffTheRecord()); | 970 !profile()->IsOffTheRecord()); |
| 971 #if defined(OS_CHROMEOS) |
| 972 command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true); |
| 973 #endif |
965 | 974 |
966 UpdateShowSyncState(true); | 975 UpdateShowSyncState(true); |
967 | 976 |
968 // Initialize other commands based on the window type. | 977 // Initialize other commands based on the window type. |
969 bool normal_window = browser_->is_type_tabbed(); | 978 bool normal_window = browser_->is_type_tabbed(); |
970 | 979 |
971 // Navigation commands | 980 // Navigation commands |
972 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); | 981 command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); |
973 | 982 |
974 // Window management commands | 983 // Window management commands |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 | 1349 |
1341 BrowserWindow* BrowserCommandController::window() { | 1350 BrowserWindow* BrowserCommandController::window() { |
1342 return browser_->window(); | 1351 return browser_->window(); |
1343 } | 1352 } |
1344 | 1353 |
1345 Profile* BrowserCommandController::profile() { | 1354 Profile* BrowserCommandController::profile() { |
1346 return browser_->profile(); | 1355 return browser_->profile(); |
1347 } | 1356 } |
1348 | 1357 |
1349 } // namespace chrome | 1358 } // namespace chrome |
OLD | NEW |