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

Unified Diff: chrome/browser/ui/ash/chrome_screenshot_taker.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: Fix missing comma. Created 6 years, 1 month 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/ash/chrome_screenshot_taker.h
diff --git a/chrome/browser/ui/ash/chrome_screenshot_taker.h b/chrome/browser/ui/ash/chrome_screenshot_taker.h
new file mode 100644
index 0000000000000000000000000000000000000000..29bfb4b2ccb2e036834b87dfb37d5a9caa28944d
--- /dev/null
+++ b/chrome/browser/ui/ash/chrome_screenshot_taker.h
@@ -0,0 +1,62 @@
+// 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_TAKER_H_
+#define CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_TAKER_H_
+
+#include "ash/screenshot_delegate.h"
+#include "chrome/browser/notifications/notification.h"
+#include "ui/snapshot/screenshot_taker.h"
+
+class Profile;
+
+namespace ash {
+namespace test {
+class ChromeScreenshotTakerTest;
+} // namespace test
+} // namespace ash
+
+class ChromeScreenshotTaker : public ash::ScreenshotDelegate,
sky 2014/11/20 15:03:58 Same comment on naming.
flackr 2014/11/26 18:05:08 Done.
+ public ui::ScreenshotTakerClient,
+ public ui::ScreenshotTakerObserver {
+ public:
+ ChromeScreenshotTaker();
+ ~ChromeScreenshotTaker() override;
+
+ ui::ScreenshotTaker* screenshot_taker() { return screenshot_taker_.get(); }
+
+ // ash::ScreenshotDelegate:
+ void HandleTakeScreenshotForAllRootWindows() override;
+ void HandleTakePartialScreenshot(aura::Window* window,
+ const gfx::Rect& rect) override;
+ bool CanTakeScreenshot() override;
+
+ // ui::ScreenshotTakerClient:
+ void PrepareWritableFileAndRunOnBlockingPool(
+ const base::FilePath& path,
+ scoped_refptr<base::TaskRunner> blocking_task_runner,
+ WritableFileCallback callback_on_blocking_pool) override;
+
+ // ui::ScreenshotTakerObserver:
+ void OnScreenshotCompleted(ui::ScreenshotTakerObserver::Result result,
+ const base::FilePath& screenshot_path) override;
+
+ protected:
+ virtual Profile* GetProfile();
sky 2014/11/20 15:03:58 I'm not a fan of virtuals just for tests. I much p
flackr 2014/11/26 18:05:08 Done.
+
+ private:
+ friend class ash::test::ChromeScreenshotTakerTest;
+
+#if defined(OS_CHROMEOS)
+ Notification* CreateNotification(
+ ui::ScreenshotTakerObserver::Result screenshot_result,
+ const base::FilePath& screenshot_path);
+#endif
+
+ scoped_ptr<ui::ScreenshotTaker> screenshot_taker_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotTaker);
+};
+
+#endif // CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_TAKER_H_

Powered by Google App Engine
This is Rietveld 408576698