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

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
« no previous file with comments | « ash/screenshot_delegate.h ('k') | chrome/browser/ui/ash/screenshot_taker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 "ui/compositor/layer.h" 12 #include "ui/compositor/layer.h"
12 13
13 namespace aura { 14 namespace aura {
14 class Window; 15 class Window;
15 } // namespace aura 16 } // namespace aura
16 17
17 class ScreenshotTaker : public ash::ScreenshotDelegate { 18 class ScreenshotTaker : public ash::ScreenshotDelegate {
18 public: 19 public:
19 ScreenshotTaker(); 20 ScreenshotTaker();
20 virtual ~ScreenshotTaker(); 21 virtual ~ScreenshotTaker();
21 22
22 // Overridden from ash::ScreenshotDelegate: 23 // Overridden from ash::ScreenshotDelegate:
23 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE; 24 virtual void HandleTakeScreenshot(aura::Window* window) OVERRIDE;
24 virtual void HandleTakePartialScreenshot( 25 virtual void HandleTakePartialScreenshot(aura::Window* window,
25 aura::Window* window, const gfx::Rect& rect) OVERRIDE; 26 const gfx::Rect& rect) OVERRIDE;
27 virtual bool CanTakeScreenshot() OVERRIDE;
26 28
27 private: 29 private:
28 // Flashes the screen to provide visual feedback that a screenshot has 30 // Flashes the screen to provide visual feedback that a screenshot has
29 // been taken. 31 // been taken.
30 void DisplayVisualFeedback(const gfx::Rect& rect); 32 void DisplayVisualFeedback(const gfx::Rect& rect);
31 33
32 // Closes the visual feedback layer. 34 // Closes the visual feedback layer.
33 void CloseVisualFeedbackLayer(); 35 void CloseVisualFeedbackLayer();
34 36
37 // The timestamp when the screenshot task was issued last time.
38 base::Time last_screenshot_timestamp_;
39
40 // The flashing effect of the screen for the visual feedback when taking a
41 // screenshot.
35 scoped_ptr<ui::Layer> visual_feedback_layer_; 42 scoped_ptr<ui::Layer> visual_feedback_layer_;
36 43
37 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); 44 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker);
38 }; 45 };
39 46
40 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 47 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
OLDNEW
« no previous file with comments | « ash/screenshot_delegate.h ('k') | chrome/browser/ui/ash/screenshot_taker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698