Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: chrome/browser/ui/ash/screenshot_taker.h

Issue 10802046: Ignores screenshot taking invocations if it's too close to the previous one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <map>
9
8 #include "ash/screenshot_delegate.h" 10 #include "ash/screenshot_delegate.h"
9 #include "base/basictypes.h" 11 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/time.h"
11 #include "ui/compositor/layer.h" 14 #include "ui/compositor/layer.h"
12 15
13 namespace aura { 16 namespace aura {
17 class RootWindow;
14 class Window; 18 class Window;
15 } // namespace aura 19 } // namespace aura
16 20
17 class ScreenshotTaker : public ash::ScreenshotDelegate { 21 class ScreenshotTaker : public ash::ScreenshotDelegate {
18 public: 22 public:
19 ScreenshotTaker(); 23 ScreenshotTaker();
20 virtual ~ScreenshotTaker(); 24 virtual ~ScreenshotTaker();
21 25
22 // Overridden from ash::ScreenshotDelegate: 26 // Overridden from ash::ScreenshotDelegate:
23 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE; 27 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE;
24 virtual void HandleTakePartialScreenshot( 28 virtual void HandleTakePartialScreenshot(aura::Window* window,
25 aura::Window* window, const gfx::Rect& rect) OVERRIDE; 29 const gfx::Rect& rect) OVERRIDE;
26 30
27 private: 31 private:
28 // Flashes the screen to provide visual feedback that a screenshot has 32 // Flashes the screen to provide visual feedback that a screenshot has
29 // been taken. 33 // been taken.
30 void DisplayVisualFeedback(const gfx::Rect& rect); 34 void DisplayVisualFeedback(const gfx::Rect& rect);
31 35
32 // Closes the visual feedback layer. 36 // Closes the visual feedback layer.
33 void CloseVisualFeedbackLayer(); 37 void CloseVisualFeedbackLayer();
34 38
39 // The timestamp when the last screenshot was taken for the root window.
40 std::map<aura::RootWindow*, base::Time> last_screenshot_timestamps_;
41
42 // The flashing effect of the screen for the visual feedback when taking a
43 // screenshot.
35 scoped_ptr<ui::Layer> visual_feedback_layer_; 44 scoped_ptr<ui::Layer> visual_feedback_layer_;
36 45
37 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); 46 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker);
38 }; 47 };
39 48
40 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 49 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/screenshot_taker.cc » ('j') | chrome/browser/ui/ash/screenshot_taker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698