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

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: 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
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 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/screenshot_delegate.h"
9 #include "ash/shell.h"
tdanderson 2014/01/09 20:28:40 These three #includes should be inside an #if defi
mfomitchev 2014/01/09 21:11:45 Done.
7 #include "base/command_line.h" 10 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/bookmarks/bookmark_model.h" 14 #include "chrome/browser/bookmarks/bookmark_model.h"
12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "chrome/browser/bookmarks/bookmark_utils.h" 16 #include "chrome/browser/bookmarks/bookmark_utils.h"
14 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/browsing_data/browsing_data_helper.h" 18 #include "chrome/browser/browsing_data/browsing_data_helper.h"
16 #include "chrome/browser/browsing_data/browsing_data_remover.h" 19 #include "chrome/browser/browsing_data/browsing_data_remover.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 #else 938 #else
936 return true; 939 return true;
937 #endif 940 #endif
938 } 941 }
939 942
940 void OpenTaskManager(Browser* browser) { 943 void OpenTaskManager(Browser* browser) {
941 content::RecordAction(UserMetricsAction("TaskManager")); 944 content::RecordAction(UserMetricsAction("TaskManager"));
942 chrome::ShowTaskManager(browser); 945 chrome::ShowTaskManager(browser);
943 } 946 }
944 947
948 void TakeScreenshot() {
tdanderson 2014/01/09 20:28:40 Surround the body of this function with an #if def
mfomitchev 2014/01/09 21:11:45 Done.
949 content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
950 ash::ScreenshotDelegate* screenshot_delegate = ash::Shell::GetInstance()->
951 accelerator_controller()->screenshot_delegate();
952 if (screenshot_delegate &&
953 screenshot_delegate->CanTakeScreenshot()) {
954 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
955 }
956 }
957
945 void OpenFeedbackDialog(Browser* browser) { 958 void OpenFeedbackDialog(Browser* browser) {
946 content::RecordAction(UserMetricsAction("Feedback")); 959 content::RecordAction(UserMetricsAction("Feedback"));
947 chrome::ShowFeedbackPage(browser, std::string(), std::string()); 960 chrome::ShowFeedbackPage(browser, std::string(), std::string());
948 } 961 }
949 962
950 void ToggleBookmarkBar(Browser* browser) { 963 void ToggleBookmarkBar(Browser* browser) {
951 content::RecordAction(UserMetricsAction("ShowBookmarksBar")); 964 content::RecordAction(UserMetricsAction("ShowBookmarksBar"));
952 ToggleBookmarkBarWhenVisible(browser->profile()); 965 ToggleBookmarkBarWhenVisible(browser->profile());
953 } 966 }
954 967
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), 1176 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(),
1164 browser->host_desktop_type())); 1177 browser->host_desktop_type()));
1165 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1178 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1166 1179
1167 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1180 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1168 contents->GetRenderViewHost()->SyncRendererPrefs(); 1181 contents->GetRenderViewHost()->SyncRendererPrefs();
1169 app_browser->window()->Show(); 1182 app_browser->window()->Show();
1170 } 1183 }
1171 1184
1172 } // namespace chrome 1185 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698