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

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: Creating browser_commands_chromeos.* and moving TakeScreenshot() there from brow 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
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..7d84c3471a53decb22ee278a4f8da04e9aaba6f7
--- /dev/null
+++ b/chrome/browser/ui/browser_commands_chromeos.cc
@@ -0,0 +1,31 @@
+// 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
+
sky 2014/01/10 19:12:32 Nuke all these empty lines.
mfomitchev 2014/01/10 19:45:57 Done.
+
+
+

Powered by Google App Engine
This is Rietveld 408576698