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

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

Issue 13105002: Screenshot effect non-obvious (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
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/memory/weak_ptr.h"
12 #include "base/string16.h"
11 #include "base/time.h" 13 #include "base/time.h"
12 #include "ui/compositor/layer.h" 14 #include "ui/gfx/image/image.h"
13 15
14 namespace aura { 16 namespace aura {
15 class Window; 17 class Window;
16 } // namespace aura 18 } // namespace aura
17 19
20 namespace base {
21 class FilePath;
22 } // namespace base
23
18 class ScreenshotTaker : public ash::ScreenshotDelegate { 24 class ScreenshotTaker : public ash::ScreenshotDelegate {
19 public: 25 public:
20 ScreenshotTaker(); 26 ScreenshotTaker();
21 virtual ~ScreenshotTaker(); 27 virtual ~ScreenshotTaker();
22 28
23 // Overridden from ash::ScreenshotDelegate: 29 // Overridden from ash::ScreenshotDelegate:
24 virtual void HandleTakeScreenshotForAllRootWindows() OVERRIDE; 30 virtual void HandleTakeScreenshotForAllRootWindows() OVERRIDE;
25 virtual void HandleTakePartialScreenshot(aura::Window* window, 31 virtual void HandleTakePartialScreenshot(aura::Window* window,
26 const gfx::Rect& rect) OVERRIDE; 32 const gfx::Rect& rect) OVERRIDE;
27 virtual bool CanTakeScreenshot() OVERRIDE; 33 virtual bool CanTakeScreenshot() OVERRIDE;
28 34
35 // Show notification that screenshot was taken or failed.
36 void ShowNotification(bool success, const base::FilePath& screenshot_path);
37
29 private: 38 private:
30 // Flashes the screen to provide visual feedback that a screenshot has 39 // WeakPtr factory.
James Cook 2013/03/26 23:54:25 Better to explain why you need weak pointers at al
sschmitz 2013/03/27 14:58:49 Removed.
31 // been taken. 40 base::WeakPtrFactory<ScreenshotTaker> factory_;
32 void DisplayVisualFeedback(const gfx::Rect& rect);
33
34 // Closes the visual feedback layer.
35 void CloseVisualFeedbackLayer();
36 41
37 // The timestamp when the screenshot task was issued last time. 42 // The timestamp when the screenshot task was issued last time.
38 base::Time last_screenshot_timestamp_; 43 base::Time last_screenshot_timestamp_;
39 44
40 // The flashing effect of the screen for the visual feedback when taking a 45 // Notification icon.
James Cook 2013/03/26 23:54:25 This comment doesn't add anything - the variable n
sschmitz 2013/03/27 14:58:49 Removed
41 // screenshot. 46 gfx::Image notification_icon_;
42 scoped_ptr<ui::Layer> visual_feedback_layer_; 47
48 // Notificaton identifier.
49 int notification_id_;
50
51 // Notification title text when successful.
James Cook 2013/03/26 23:54:25 Likewise, none of these comments add anything. I m
sschmitz 2013/03/27 14:58:49 Removed
52 string16 notification_title_success_;
53
54 // Notification title text when a failure occurred.
55 string16 notification_title_fail_;
56
57 // Notification body text when successful.
58 string16 notification_text_success_;
59
60 // Notification body text when a failure occurred.
61 string16 notification_text_fail_;
43 62
44 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker); 63 DISALLOW_COPY_AND_ASSIGN(ScreenshotTaker);
45 }; 64 };
46 65
47 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_ 66 #endif // CHROME_BROWSER_UI_ASH_SCREENSHOT_TAKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698