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

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: Moving ifdef in browser_commands.cc 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "content/public/browser/render_view_host.h" 69 #include "content/public/browser/render_view_host.h"
70 #include "content/public/browser/user_metrics.h" 70 #include "content/public/browser/user_metrics.h"
71 #include "content/public/browser/web_contents.h" 71 #include "content/public/browser/web_contents.h"
72 #include "content/public/browser/web_contents_view.h" 72 #include "content/public/browser/web_contents_view.h"
73 #include "content/public/common/renderer_preferences.h" 73 #include "content/public/common/renderer_preferences.h"
74 #include "content/public/common/url_constants.h" 74 #include "content/public/common/url_constants.h"
75 #include "content/public/common/url_utils.h" 75 #include "content/public/common/url_utils.h"
76 #include "net/base/escape.h" 76 #include "net/base/escape.h"
77 #include "webkit/common/user_agent/user_agent_util.h" 77 #include "webkit/common/user_agent/user_agent_util.h"
78 78
79 #if defined(OS_CHROMEOS)
80 #include "ash/accelerators/accelerator_controller.h"
81 #include "ash/screenshot_delegate.h"
82 #include "ash/shell.h"
83 #endif
84
79 #if defined(OS_WIN) 85 #if defined(OS_WIN)
80 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" 86 #include "chrome/browser/ui/metro_pin_tab_helper_win.h"
81 #include "win8/util/win8_util.h" 87 #include "win8/util/win8_util.h"
82 #endif 88 #endif
83 89
84 #if defined(ENABLE_PRINTING) 90 #if defined(ENABLE_PRINTING)
85 #if defined(ENABLE_FULL_PRINTING) 91 #if defined(ENABLE_FULL_PRINTING)
86 #include "chrome/browser/printing/print_preview_dialog_controller.h" 92 #include "chrome/browser/printing/print_preview_dialog_controller.h"
87 #include "chrome/browser/printing/print_view_manager.h" 93 #include "chrome/browser/printing/print_view_manager.h"
88 #else 94 #else
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 #else 941 #else
936 return true; 942 return true;
937 #endif 943 #endif
938 } 944 }
939 945
940 void OpenTaskManager(Browser* browser) { 946 void OpenTaskManager(Browser* browser) {
941 content::RecordAction(UserMetricsAction("TaskManager")); 947 content::RecordAction(UserMetricsAction("TaskManager"));
942 chrome::ShowTaskManager(browser); 948 chrome::ShowTaskManager(browser);
943 } 949 }
944 950
951 void TakeScreenshot() {
sky 2014/01/10 00:02:52 If this is chromeos specific, then move to browser
mfomitchev 2014/01/10 18:06:50 Done.
952 #if defined(OS_CHROMEOS)
sadrul 2014/01/09 21:39:33 I was going to suggest using USE_ASH instead of OS
mfomitchev 2014/01/09 22:07:23 I think that's because on other OSes there are oth
953 content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
954 ash::ScreenshotDelegate* screenshot_delegate = ash::Shell::GetInstance()->
955 accelerator_controller()->screenshot_delegate();
956 if (screenshot_delegate &&
957 screenshot_delegate->CanTakeScreenshot()) {
958 screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
959 }
960 #endif
961 }
962
945 void OpenFeedbackDialog(Browser* browser) { 963 void OpenFeedbackDialog(Browser* browser) {
946 content::RecordAction(UserMetricsAction("Feedback")); 964 content::RecordAction(UserMetricsAction("Feedback"));
947 chrome::ShowFeedbackPage(browser, std::string(), std::string()); 965 chrome::ShowFeedbackPage(browser, std::string(), std::string());
948 } 966 }
949 967
950 void ToggleBookmarkBar(Browser* browser) { 968 void ToggleBookmarkBar(Browser* browser) {
951 content::RecordAction(UserMetricsAction("ShowBookmarksBar")); 969 content::RecordAction(UserMetricsAction("ShowBookmarksBar"));
952 ToggleBookmarkBarWhenVisible(browser->profile()); 970 ToggleBookmarkBarWhenVisible(browser->profile());
953 } 971 }
954 972
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), 1181 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(),
1164 browser->host_desktop_type())); 1182 browser->host_desktop_type()));
1165 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1183 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1166 1184
1167 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1185 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1168 contents->GetRenderViewHost()->SyncRendererPrefs(); 1186 contents->GetRenderViewHost()->SyncRendererPrefs();
1169 app_browser->window()->Show(); 1187 app_browser->window()->Show();
1170 } 1188 }
1171 1189
1172 } // namespace chrome 1190 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698