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.
5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_
6 #define CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_
8 #include "ash/screenshot_delegate.h"
9 #include "chrome/browser/notifications/notification.h"
10 #include "ui/snapshot/screenshot_grabber.h"
16 class ChromeScreenshotGrabberTest
;
20 class ChromeScreenshotGrabber
: public ash::ScreenshotDelegate
,
21 public ui::ScreenshotGrabberDelegate
,
22 public ui::ScreenshotGrabberObserver
{
24 ChromeScreenshotGrabber();
25 ~ChromeScreenshotGrabber() override
;
27 ui::ScreenshotGrabber
* screenshot_grabber() {
28 return screenshot_grabber_
.get();
31 // ash::ScreenshotDelegate:
32 void HandleTakeScreenshotForAllRootWindows() override
;
33 void HandleTakePartialScreenshot(aura::Window
* window
,
34 const gfx::Rect
& rect
) override
;
35 bool CanTakeScreenshot() override
;
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
;
43 // ui::ScreenshotGrabberObserver:
44 void OnScreenshotCompleted(ui::ScreenshotGrabberObserver::Result result
,
45 const base::FilePath
& screenshot_path
) override
;
48 friend class ash::test::ChromeScreenshotGrabberTest
;
50 #if defined(OS_CHROMEOS)
51 Notification
* CreateNotification(
52 ui::ScreenshotGrabberObserver::Result screenshot_result
,
53 const base::FilePath
& screenshot_path
);
56 void SetProfileForTest(Profile
* profile
);
57 Profile
* GetProfile();
59 scoped_ptr
<ui::ScreenshotGrabber
> screenshot_grabber_
;
60 Profile
* profile_for_test_
;
62 DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotGrabber
);
65 #endif // CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_GRABBER_H_