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

Unified Diff: chrome/browser/ui/browser_commands_chromeos.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: Nuking some empty lines 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_commands_chromeos.h ('k') | chrome/browser/ui/toolbar/wrench_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands_chromeos.cc
diff --git a/chrome/browser/ui/browser_commands_chromeos.cc b/chrome/browser/ui/browser_commands_chromeos.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8793943271188c31e1fbe85d978cec66b1388830
--- /dev/null
+++ b/chrome/browser/ui/browser_commands_chromeos.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/browser_commands_chromeos.h"
+
+#include "ash/accelerators/accelerator_controller.h"
+#include "ash/screenshot_delegate.h"
+#include "ash/shell.h"
+#include "content/public/browser/user_metrics.h"
+#include "content/public/common/user_metrics_action.h"
+
+using content::UserMetricsAction;
+
+namespace chrome {
+
+void TakeScreenshot() {
+ content::RecordAction(UserMetricsAction("Menu_Take_Screenshot"));
+ ash::ScreenshotDelegate* screenshot_delegate = ash::Shell::GetInstance()->
+ accelerator_controller()->screenshot_delegate();
+ if (screenshot_delegate &&
+ screenshot_delegate->CanTakeScreenshot()) {
+ screenshot_delegate->HandleTakeScreenshotForAllRootWindows();
+ }
+}
+
+} // namespace chrome
« no previous file with comments | « chrome/browser/ui/browser_commands_chromeos.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