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

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

Issue 132233003: Adding a menu item to take a screenshot under "More Tools" submenu in the Wrench menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing ifdefs Created 6 years, 11 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
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_commands.h" 5 #include "chrome/browser/ui/browser_commands.h"
6 6
7 #if defined(OS_CHROMEOS)
8 #include "ash/accelerators/accelerator_controller.h"
9 #include "ash/screenshot_delegate.h"
10 #include "ash/shell.h"
11 #endif
tdanderson 2014/01/09 21:25:29 Move this block after the #if defined(OS_WIN) bloc
mfomitchev 2014/01/09 21:32:30 Done.
7 #include "base/command_line.h" 12 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 17 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "chrome/browser/bookmarks/bookmark_utils.h" 18 #include "chrome/browser/bookmarks/bookmark_utils.h"
14 #include "chrome/browser/browser_process.h" 19 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browsing_data/browsing_data_helper.h" 20 #include "chrome/browser/browsing_data/browsing_data_helper.h"
16 #include "chrome/browser/browsing_data/browsing_data_remover.h" 21 #include "chrome/browser/browsing_data/browsing_data_remover.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 #else 940 #else
936 return true; 941 return true;
937 #endif 942 #endif
938 } 943 }
939 944
940 void OpenTaskManager(Browser* browser) { 945 void OpenTaskManager(Browser* browser) {
941 content::RecordAction(UserMetricsAction("TaskManager")); 946 content::RecordAction(UserMetricsAction("TaskManager"));
942 chrome::ShowTaskManager(browser); 947 chrome::ShowTaskManager(browser);
943 } 948 }
944 949
950 void TakeScreenshot() {
951 #if defined(OS_CHROMEOS)
952 content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
953 ash::ScreenshotDelegate* screenshot_delegate = ash::Shell::GetInstance()->
954 accelerator_controller()->screenshot_delegate();
955 if (screenshot_delegate &&
956 screenshot_delegate->CanTakeScreenshot()) {
957 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
958 }
959 #endif
960 }
961
945 void OpenFeedbackDialog(Browser* browser) { 962 void OpenFeedbackDialog(Browser* browser) {
946 content::RecordAction(UserMetricsAction("Feedback")); 963 content::RecordAction(UserMetricsAction("Feedback"));
947 chrome::ShowFeedbackPage(browser, std::string(), std::string()); 964 chrome::ShowFeedbackPage(browser, std::string(), std::string());
948 } 965 }
949 966
950 void ToggleBookmarkBar(Browser* browser) { 967 void ToggleBookmarkBar(Browser* browser) {
951 content::RecordAction(UserMetricsAction("ShowBookmarksBar")); 968 content::RecordAction(UserMetricsAction("ShowBookmarksBar"));
952 ToggleBookmarkBarWhenVisible(browser->profile()); 969 ToggleBookmarkBarWhenVisible(browser->profile());
953 } 970 }
954 971
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), 1180 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(),
1164 browser->host_desktop_type())); 1181 browser->host_desktop_type()));
1165 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1182 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1166 1183
1167 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1184 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1168 contents->GetRenderViewHost()->SyncRendererPrefs(); 1185 contents->GetRenderViewHost()->SyncRendererPrefs();
1169 app_browser->window()->Show(); 1186 app_browser->window()->Show();
1170 } 1187 }
1171 1188
1172 } // namespace chrome 1189 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698