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

Unified Diff: chrome/browser/ui/ash/chrome_screenshot_grabber.h

Issue 706013004: Move non-browser specific ScreenshotTaker code to ui/snapshot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge and fix gn Created 6 years 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/ash/ash_init.cc ('k') | chrome/browser/ui/ash/chrome_screenshot_grabber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/chrome_screenshot_grabber.h
diff --git a/chrome/browser/ui/ash/chrome_screenshot_grabber.h b/chrome/browser/ui/ash/chrome_screenshot_grabber.h
new file mode 100644
index 0000000000000000000000000000000000000000..083f32d95c84dfa1964aa40f7ee8c93f66619aa8
--- /dev/null
+++ b/chrome/browser/ui/ash/chrome_screenshot_grabber.h
@@ -0,0 +1,65 @@
+// Copyright 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.
+
+#ifndef CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_
+#define CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_
+
+#include "ash/screenshot_delegate.h"
+#include "chrome/browser/notifications/notification.h"
+#include "ui/snapshot/screenshot_grabber.h"
+
+class Profile;
+
+namespace ash {
+namespace test {
+class ChromeScreenshotGrabberTest;
+} // namespace test
+} // namespace ash
+
+class ChromeScreenshotGrabber : public ash::ScreenshotDelegate,
+ public ui::ScreenshotGrabberDelegate,
+ public ui::ScreenshotGrabberObserver {
+ public:
+ ChromeScreenshotGrabber();
+ ~ChromeScreenshotGrabber() override;
+
+ ui::ScreenshotGrabber* screenshot_grabber() {
+ return screenshot_grabber_.get();
+ }
+
+ // ash::ScreenshotDelegate:
+ void HandleTakeScreenshotForAllRootWindows() override;
+ void HandleTakePartialScreenshot(aura::Window* window,
+ const gfx::Rect& rect) override;
+ bool CanTakeScreenshot() override;
+
+ // ui::ScreenshotGrabberDelegate:
+ void PrepareFileAndRunOnBlockingPool(
+ const base::FilePath& path,
+ scoped_refptr<base::TaskRunner> blocking_task_runner,
+ const FileCallback& callback_on_blocking_pool) override;
+
+ // ui::ScreenshotGrabberObserver:
+ void OnScreenshotCompleted(ui::ScreenshotGrabberObserver::Result result,
+ const base::FilePath& screenshot_path) override;
+
+ private:
+ friend class ash::test::ChromeScreenshotGrabberTest;
+
+#if defined(OS_CHROMEOS)
+ Notification* CreateNotification(
+ ui::ScreenshotGrabberObserver::Result screenshot_result,
+ const base::FilePath& screenshot_path);
+#endif
+
+ void SetProfileForTest(Profile* profile);
+ Profile* GetProfile();
+
+ scoped_ptr<ui::ScreenshotGrabber> screenshot_grabber_;
+ Profile* profile_for_test_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotGrabber);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_
« no previous file with comments | « chrome/browser/ui/ash/ash_init.cc ('k') | chrome/browser/ui/ash/chrome_screenshot_grabber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698