OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ |
6 #define CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ | 6 #define CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ |
7 | 7 |
8 #include "ash/screenshot_delegate.h" | 8 #include "ash/screenshot_delegate.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "ui/compositor/layer.h" | 12 #include "ui/compositor/layer.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 class Window; | 15 class Window; |
16 } // namespace aura | 16 } // namespace aura |
17 | 17 |
18 class ScreenshotTaker : public ash::ScreenshotDelegate { | 18 class ScreenshotTaker : public ash::ScreenshotDelegate { |
19 public: | 19 public: |
20 ScreenshotTaker(); | 20 ScreenshotTaker(); |
21 virtual ~ScreenshotTaker(); | 21 virtual ~ScreenshotTaker(); |
22 | 22 |
23 // Overridden from ash::ScreenshotDelegate: | 23 // Overridden from ash::ScreenshotDelegate: |
24 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE; | 24 virtual void HandleTakeScreenshotForAllRootWindows() OVERRIDE; |
25 virtual void HandleTakePartialScreenshot(aura::Window* window, | 25 virtual void HandleTakePartialScreenshot(aura::Window* window, |
26 const gfx::Rect& rect) OVERRIDE; | 26 const gfx::Rect& rect) OVERRIDE; |
27 virtual bool CanTakeScreenshot() OVERRIDE; | 27 virtual bool CanTakeScreenshot() OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 // Flashes the screen to provide visual feedback that a screenshot has | 30 // Flashes the screen to provide visual feedback that a screenshot has |
31 // been taken. | 31 // been taken. |
32 void DisplayVisualFeedback(const gfx::Rect& rect); | 32 void DisplayVisualFeedback(const gfx::Rect& rect); |
33 | 33 |
34 // Closes the visual feedback layer. | 34 // Closes the visual feedback layer. |
35 void CloseVisualFeedbackLayer(); | 35 void CloseVisualFeedbackLayer(); |
36 | 36 |
37 // The timestamp when the screenshot task was issued last time. | 37 // The timestamp when the screenshot task was issued last time. |
38 base::Time last_screenshot_timestamp_; | 38 base::Time last_screenshot_timestamp_; |
39 | 39 |
40 // The flashing effect of the screen for the visual feedback when taking a | 40 // The flashing effect of the screen for the visual feedback when taking a |
41 // screenshot. | 41 // screenshot. |
42 scoped_ptr<ui::Layer> visual_feedback_layer_; | 42 scoped_ptr<ui::Layer> visual_feedback_layer_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); | 44 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); |
45 }; | 45 }; |
46 | 46 |
47 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ | 47 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ |
OLD | NEW |