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_VIEWS_ASH_SCREENSHOT_TAKER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_SCREENSHOT_TAKER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_ASH_SCREENSHOT_TAKER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_SCREENSHOT_TAKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/screenshot_delegate.h" | 9 #include "ash/screenshot_delegate.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
12 #include "ui/gfx/compositor/layer.h" | 13 #include "ui/gfx/compositor/layer.h" |
13 | 14 |
14 namespace aura { | 15 namespace aura { |
15 class Window; | 16 class Window; |
16 } // namespace aura | 17 } // namespace aura |
17 | 18 |
18 class ScreenshotTaker : public ash::ScreenshotDelegate { | 19 class ScreenshotTaker : public ash::ScreenshotDelegate { |
19 public: | 20 public: |
20 ScreenshotTaker(); | 21 ScreenshotTaker(); |
21 virtual ~ScreenshotTaker(); | 22 virtual ~ScreenshotTaker(); |
22 | 23 |
23 // Overridden from ash::ScreenshotDelegate: | 24 // Overridden from ash::ScreenshotDelegate: |
24 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE; | 25 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE; |
25 virtual void HandleTakePartialScreenshot( | 26 virtual void HandleTakePartialScreenshot( |
26 aura::Window* window, const gfx::Rect& rect) OVERRIDE; | 27 aura::Window* window, const gfx::Rect& rect) OVERRIDE; |
27 | 28 |
28 private: | 29 private: |
29 // Flashes the screen to provide visual feedback that a screenshot has | 30 // Flashes the screen to provide visual feedback that a screenshot has |
30 // been taken. | 31 // been taken. |task| runs after the visual feedback finishes. |
31 void DisplayVisualFeedback(const gfx::Rect& rect); | 32 void DisplayVisualFeedback(const gfx::Rect& rect, const base::Closure& task); |
32 | 33 |
33 // Closes the visual feedback layer. | 34 // Closes the visual feedback layer. |task| runs after the visual |
34 void CloseVisualFeedbackLayer(); | 35 // feedback finishes. |
| 36 void CloseVisualFeedbackLayer(const base::Closure& task); |
35 | 37 |
36 scoped_ptr<ui::Layer> visual_feedback_layer_; | 38 scoped_ptr<ui::Layer> visual_feedback_layer_; |
37 | 39 |
38 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); | 40 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); |
39 }; | 41 }; |
40 | 42 |
41 #endif // CHROME_BROWSER_UI_VIEWS_ASH_SCREENSHOT_TAKER_H_ | 43 #endif // CHROME_BROWSER_UI_VIEWS_ASH_SCREENSHOT_TAKER_H_ |
OLD | NEW |