OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ | 5 #ifndef UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ |
6 #define UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ | 6 #define UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 | 69 |
70 void NotifyScreenshotCompleted( | 70 void NotifyScreenshotCompleted( |
71 ScreenshotGrabberObserver::Result screenshot_result, | 71 ScreenshotGrabberObserver::Result screenshot_result, |
72 const base::FilePath& screenshot_path); | 72 const base::FilePath& screenshot_path); |
73 | 73 |
74 void AddObserver(ScreenshotGrabberObserver* observer); | 74 void AddObserver(ScreenshotGrabberObserver* observer); |
75 void RemoveObserver(ScreenshotGrabberObserver* observer); | 75 void RemoveObserver(ScreenshotGrabberObserver* observer); |
76 bool HasObserver(const ScreenshotGrabberObserver* observer) const; | 76 bool HasObserver(const ScreenshotGrabberObserver* observer) const; |
77 | 77 |
78 private: | 78 private: |
79 #if defined(USE_AURA) | |
80 class ScopedCursorHider; | |
81 | |
82 // The object to hide cursor when taking screenshot. | |
83 std::unique_ptr<ScopedCursorHider> cursor_hider_; | |
sky
2016/07/22 16:14:44
members go after functions (see style guide).
Qiang(Joe) Xu
2016/07/22 20:15:26
Done.
| |
84 #endif | |
85 | |
79 void GrabWindowSnapshotAsyncCallback( | 86 void GrabWindowSnapshotAsyncCallback( |
80 const std::string& window_identifier, | 87 const std::string& window_identifier, |
81 base::FilePath screenshot_path, | 88 base::FilePath screenshot_path, |
82 bool is_partial, | 89 bool is_partial, |
83 scoped_refptr<base::RefCountedBytes> png_data); | 90 scoped_refptr<base::RefCountedBytes> png_data); |
84 | 91 |
85 // A weak pointer to the screenshot taker client. | 92 // A weak pointer to the screenshot taker client. |
86 ScreenshotGrabberDelegate* client_; | 93 ScreenshotGrabberDelegate* client_; |
87 | 94 |
88 // The timestamp when the screenshot task was issued last time. | 95 // The timestamp when the screenshot task was issued last time. |
89 base::TimeTicks last_screenshot_timestamp_; | 96 base::TimeTicks last_screenshot_timestamp_; |
90 | 97 |
91 // Task runner for blocking tasks. | 98 // Task runner for blocking tasks. |
92 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 99 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
93 | 100 |
94 base::ObserverList<ScreenshotGrabberObserver> observers_; | 101 base::ObserverList<ScreenshotGrabberObserver> observers_; |
95 base::WeakPtrFactory<ScreenshotGrabber> factory_; | 102 base::WeakPtrFactory<ScreenshotGrabber> factory_; |
96 | 103 |
97 DISALLOW_COPY_AND_ASSIGN(ScreenshotGrabber); | 104 DISALLOW_COPY_AND_ASSIGN(ScreenshotGrabber); |
98 }; | 105 }; |
99 | 106 |
100 } // namespace ui | 107 } // namespace ui |
101 | 108 |
102 #endif // UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ | 109 #endif // UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ |
OLD | NEW |