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_TAKER_H_ | |
6 #define CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_TAKER_H_ | |
7 | |
8 #include "ash/screenshot_delegate.h" | |
9 #include "chrome/browser/notifications/notification.h" | |
10 #include "ui/snapshot/screenshot_taker.h" | |
11 | |
12 class Profile; | |
13 | |
14 namespace ash { | |
15 namespace test { | |
16 class ChromeScreenshotTakerTest; | |
17 } // namespace test | |
18 } // namespace ash | |
19 | |
20 class ChromeScreenshotTaker : public ash::ScreenshotDelegate, | |
sky
2014/11/20 15:03:58
Same comment on naming.
flackr
2014/11/26 18:05:08
Done.
| |
21 public ui::ScreenshotTakerClient, | |
22 public ui::ScreenshotTakerObserver { | |
23 public: | |
24 ChromeScreenshotTaker(); | |
25 ~ChromeScreenshotTaker() override; | |
26 | |
27 ui::ScreenshotTaker* screenshot_taker() { return screenshot_taker_.get(); } | |
28 | |
29 // ash::ScreenshotDelegate: | |
30 void HandleTakeScreenshotForAllRootWindows() override; | |
31 void HandleTakePartialScreenshot(aura::Window* window, | |
32 const gfx::Rect& rect) override; | |
33 bool CanTakeScreenshot() override; | |
34 | |
35 // ui::ScreenshotTakerClient: | |
36 void PrepareWritableFileAndRunOnBlockingPool( | |
37 const base::FilePath& path, | |
38 scoped_refptr<base::TaskRunner> blocking_task_runner, | |
39 WritableFileCallback callback_on_blocking_pool) override; | |
40 | |
41 // ui::ScreenshotTakerObserver: | |
42 void OnScreenshotCompleted(ui::ScreenshotTakerObserver::Result result, | |
43 const base::FilePath& screenshot_path) override; | |
44 | |
45 protected: | |
46 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.
| |
47 | |
48 private: | |
49 friend class ash::test::ChromeScreenshotTakerTest; | |
50 | |
51 #if defined(OS_CHROMEOS) | |
52 Notification* CreateNotification( | |
53 ui::ScreenshotTakerObserver::Result screenshot_result, | |
54 const base::FilePath& screenshot_path); | |
55 #endif | |
56 | |
57 scoped_ptr<ui::ScreenshotTaker> screenshot_taker_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(ChromeScreenshotTaker); | |
60 }; | |
61 | |
62 #endif // CHROME_BROWSER_UI_ASH_CHROME_SCREENSHOT_TAKER_H_ | |
OLD | NEW |