Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: chrome/browser/ui/browser_command_controller.cc

Issue 885673004: Adding menu item to take screenshot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making new menu item only available under Chrome OS Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "ash/accelerators/accelerator_commands.h" 59 #include "ash/accelerators/accelerator_commands.h"
60 #include "chrome/browser/ui/ash/ash_util.h" 60 #include "chrome/browser/ui/ash/ash_util.h"
61 #endif 61 #endif
62 62
63 #if defined(OS_CHROMEOS) 63 #if defined(OS_CHROMEOS)
64 #include "ash/multi_profile_uma.h" 64 #include "ash/multi_profile_uma.h"
65 #include "ash/session/session_state_delegate.h" 65 #include "ash/session/session_state_delegate.h"
66 #include "ash/shell.h" 66 #include "ash/shell.h"
67 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h" 67 #include "chrome/browser/ui/ash/multi_user/multi_user_context_menu.h"
68 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" 68 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
69 #include "chrome/browser/ui/browser_commands_chromeos.h"
69 #endif 70 #endif
70 71
71 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 72 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
72 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h" 73 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h"
73 #endif 74 #endif
74 75
75 using content::NavigationEntry; 76 using content::NavigationEntry;
76 using content::NavigationController; 77 using content::NavigationController;
77 using content::WebContents; 78 using content::WebContents;
78 79
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 break; 689 break;
689 case IDC_DEV_TOOLS_INSPECT: 690 case IDC_DEV_TOOLS_INSPECT:
690 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Inspect()); 691 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Inspect());
691 break; 692 break;
692 case IDC_DEV_TOOLS_TOGGLE: 693 case IDC_DEV_TOOLS_TOGGLE:
693 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Toggle()); 694 ToggleDevToolsWindow(browser_, DevToolsToggleAction::Toggle());
694 break; 695 break;
695 case IDC_TASK_MANAGER: 696 case IDC_TASK_MANAGER:
696 OpenTaskManager(browser_); 697 OpenTaskManager(browser_);
697 break; 698 break;
699 #if defined(OS_CHROMEOS)
700 case IDC_TAKE_SCREENSHOT:
701 TakeScreenshot();
702 break;
703 #endif
698 #if defined(GOOGLE_CHROME_BUILD) 704 #if defined(GOOGLE_CHROME_BUILD)
699 case IDC_FEEDBACK: 705 case IDC_FEEDBACK:
700 OpenFeedbackDialog(browser_); 706 OpenFeedbackDialog(browser_);
701 break; 707 break;
702 #endif 708 #endif
703 case IDC_SHOW_BOOKMARK_BAR: 709 case IDC_SHOW_BOOKMARK_BAR:
704 ToggleBookmarkBar(browser_); 710 ToggleBookmarkBar(browser_);
705 break; 711 break;
706 case IDC_PROFILING_ENABLED: 712 case IDC_PROFILING_ENABLED:
707 Profiling::Toggle(); 713 Profiling::Toggle();
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); 965 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true);
960 command_updater_.UpdateCommandEnabled(IDC_HELP_MENU, true); 966 command_updater_.UpdateCommandEnabled(IDC_HELP_MENU, true);
961 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true); 967 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true);
962 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true); 968 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true);
963 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, !guest_session); 969 command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, !guest_session);
964 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU, 970 command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU,
965 !guest_session && 971 !guest_session &&
966 !profile()->IsOffTheRecord()); 972 !profile()->IsOffTheRecord());
967 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); 973 command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window);
968 #if defined(OS_CHROMEOS) 974 #if defined(OS_CHROMEOS)
975 command_updater_.UpdateCommandEnabled(IDC_TAKE_SCREENSHOT, true);
969 command_updater_.UpdateCommandEnabled(IDC_TOUCH_HUD_PROJECTION_TOGGLE, true); 976 command_updater_.UpdateCommandEnabled(IDC_TOUCH_HUD_PROJECTION_TOGGLE, true);
970 #else 977 #else
971 // Chrome OS uses the system tray menu to handle multi-profiles. 978 // Chrome OS uses the system tray menu to handle multi-profiles.
972 if (normal_window && (guest_session || !profile()->IsOffTheRecord())) 979 if (normal_window && (guest_session || !profile()->IsOffTheRecord()))
973 command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU, true); 980 command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU, true);
974 #endif 981 #endif
975 982
976 UpdateShowSyncState(true); 983 UpdateShowSyncState(true);
977 984
978 // Navigation commands 985 // Navigation commands
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 1353
1347 BrowserWindow* BrowserCommandController::window() { 1354 BrowserWindow* BrowserCommandController::window() {
1348 return browser_->window(); 1355 return browser_->window();
1349 } 1356 }
1350 1357
1351 Profile* BrowserCommandController::profile() { 1358 Profile* BrowserCommandController::profile() {
1352 return browser_->profile(); 1359 return browser_->profile();
1353 } 1360 }
1354 1361
1355 } // namespace chrome 1362 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698