OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_ |
| 7 |
| 8 #include "ash/screenshot_delegate.h" |
| 9 #include "chrome/browser/notifications/notification.h" |
| 10 #include "ui/snapshot/screenshot_grabber.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 namespace ash { |
| 15 namespace test { |
| 16 class ChromeScreenshotGrabberTest; |
| 17 } // namespace test |
| 18 } // namespace ash |
| 19 |
| 20 class ChromeScreenshotGrabber : public ash::ScreenshotDelegate, |
| 21 public ui::ScreenshotGrabberDelegate, |
| 22 public ui::ScreenshotGrabberObserver { |
| 23 public: |
| 24 ChromeScreenshotGrabber(); |
| 25 ~ChromeScreenshotGrabber() override; |
| 26 |
| 27 ui::ScreenshotGrabber* screenshot_grabber() { |
| 28 return screenshot_grabber_.get(); |
| 29 } |
| 30 |
| 31 // ash::ScreenshotDelegate: |
| 32 void HandleTakeScreenshotForAllRootWindows() override; |
| 33 void HandleTakePartialScreenshot(aura::Window* window, |
| 34 const gfx::Rect& rect) override; |
| 35 bool CanTakeScreenshot() override; |
| 36 |
| 37 // ui::ScreenshotGrabberDelegate: |
| 38 void PrepareFileAndRunOnBlockingPool( |
| 39 const base::FilePath& path, |
| 40 scoped_refptr<base::TaskRunner> blocking_task_runner, |
| 41 const FileCallback& callback_on_blocking_pool) override; |
| 42 |
| 43 // ui::ScreenshotGrabberObserver: |
| 44 void OnScreenshotCompleted(ui::ScreenshotGrabberObserver::Result result, |
| 45 const base::FilePath& screenshot_path) override; |
| 46 |
| 47 private: |
| 48 friend class ash::test::ChromeScreenshotGrabberTest; |
| 49 |
| 50 #if defined(OS_CHROMEOS) |
| 51 Notification* CreateNotification( |
| 52 ui::ScreenshotGrabberObserver::Result screenshot_result, |
| 53 const base::FilePath& screenshot_path); |
| 54 #endif |
| 55 |
| 56 void SetProfileForTest(Profile* profile); |
| 57 Profile* GetProfile(); |
| 58 |
| 59 scoped_ptr<ui::ScreenshotGrabber> screenshot_grabber_; |
| 60 Profile* profile_for_test_; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotGrabber); |
| 63 }; |
| 64 |
| 65 #endif // CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_ |
OLD | NEW |