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

Side by Side Diff: ui/snapshot/screenshot_grabber.h

Issue 2167613003: Hide mouse cursor when screenshot is taking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit adjustment Created 4 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
« no previous file with comments | « no previous file | ui/snapshot/screenshot_grabber.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 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
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 #endif
82
79 void GrabWindowSnapshotAsyncCallback( 83 void GrabWindowSnapshotAsyncCallback(
80 const std::string& window_identifier, 84 const std::string& window_identifier,
81 base::FilePath screenshot_path, 85 base::FilePath screenshot_path,
82 bool is_partial, 86 bool is_partial,
83 scoped_refptr<base::RefCountedBytes> png_data); 87 scoped_refptr<base::RefCountedBytes> png_data);
84 88
85 // A weak pointer to the screenshot taker client. 89 // A weak pointer to the screenshot taker client.
86 ScreenshotGrabberDelegate* client_; 90 ScreenshotGrabberDelegate* client_;
87 91
88 // The timestamp when the screenshot task was issued last time. 92 // The timestamp when the screenshot task was issued last time.
89 base::TimeTicks last_screenshot_timestamp_; 93 base::TimeTicks last_screenshot_timestamp_;
90 94
91 // Task runner for blocking tasks. 95 // Task runner for blocking tasks.
92 scoped_refptr<base::TaskRunner> blocking_task_runner_; 96 scoped_refptr<base::TaskRunner> blocking_task_runner_;
93 97
98 #if defined(USE_AURA)
99 // The object to hide cursor when taking screenshot.
100 std::unique_ptr<ScopedCursorHider> cursor_hider_;
101 #endif
102
94 base::ObserverList<ScreenshotGrabberObserver> observers_; 103 base::ObserverList<ScreenshotGrabberObserver> observers_;
95 base::WeakPtrFactory<ScreenshotGrabber> factory_; 104 base::WeakPtrFactory<ScreenshotGrabber> factory_;
96 105
97 DISALLOW_COPY_AND_ASSIGN(ScreenshotGrabber); 106 DISALLOW_COPY_AND_ASSIGN(ScreenshotGrabber);
98 }; 107 };
99 108
100 } // namespace ui 109 } // namespace ui
101 110
102 #endif // UI_SNAPSHOT_SCREENSHOT_GRABBER_H_ 111 #endif // UI_SNAPSHOT_SCREENSHOT_GRABBER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/snapshot/screenshot_grabber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698