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

Side by Side Diff: chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h

Issue 1135413002: Disable screenshot uploading if there has been user input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 5 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 10 matching lines...) Expand all
21 21
22 // An implementation of the |DeviceCommandScreenshotJob::Delegate| that uses 22 // An implementation of the |DeviceCommandScreenshotJob::Delegate| that uses
23 // aura's GrabWindowSnapshotAsync() to acquire the window snapshot. 23 // aura's GrabWindowSnapshotAsync() to acquire the window snapshot.
24 class ScreenshotDelegate : public DeviceCommandScreenshotJob::Delegate { 24 class ScreenshotDelegate : public DeviceCommandScreenshotJob::Delegate {
25 public: 25 public:
26 explicit ScreenshotDelegate( 26 explicit ScreenshotDelegate(
27 scoped_refptr<base::TaskRunner> blocking_task_runner); 27 scoped_refptr<base::TaskRunner> blocking_task_runner);
28 ~ScreenshotDelegate() override; 28 ~ScreenshotDelegate() override;
29 29
30 // DeviceCommandScreenshotJob::Delegate: 30 // DeviceCommandScreenshotJob::Delegate:
31 bool IsScreenshotAllowed() override;
31 void TakeSnapshot( 32 void TakeSnapshot(
32 gfx::NativeWindow window, 33 gfx::NativeWindow window,
33 const gfx::Rect& source_rect, 34 const gfx::Rect& source_rect,
34 const ui::GrabWindowSnapshotAsyncPNGCallback& callback) override; 35 const ui::GrabWindowSnapshotAsyncPNGCallback& callback) override;
35 scoped_ptr<UploadJob> CreateUploadJob(const GURL& upload_url, 36 scoped_ptr<UploadJob> CreateUploadJob(const GURL& upload_url,
36 UploadJob::Delegate* delegate) override; 37 UploadJob::Delegate* delegate) override;
37 38
38 private: 39 private:
39 void StoreScreenshot(const ui::GrabWindowSnapshotAsyncPNGCallback& callback, 40 void StoreScreenshot(const ui::GrabWindowSnapshotAsyncPNGCallback& callback,
40 scoped_refptr<base::RefCountedBytes> png_data); 41 scoped_refptr<base::RefCountedBytes> png_data);
41 42
42 scoped_refptr<base::TaskRunner> blocking_task_runner_; 43 scoped_refptr<base::TaskRunner> blocking_task_runner_;
43 44
44 base::WeakPtrFactory<ScreenshotDelegate> weak_ptr_factory_; 45 base::WeakPtrFactory<ScreenshotDelegate> weak_ptr_factory_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(ScreenshotDelegate); 47 DISALLOW_COPY_AND_ASSIGN(ScreenshotDelegate);
47 }; 48 };
48 49
49 } // namespace policy 50 } // namespace policy
50 51
51 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_ 52 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_SCREENSHOT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698