| OLD | NEW |
| 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_DEVICE_COMMAND_SCREENSHOT
_JOB_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SCREENSHOT
_JOB_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SCREENSHOT
_JOB_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SCREENSHOT
_JOB_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Failed due to a client-side error. | 55 // Failed due to a client-side error. |
| 56 FAILURE_CLIENT = 5 | 56 FAILURE_CLIENT = 5 |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // A delegate interface used by DeviceCommandScreenshotJob to retrieve its | 59 // A delegate interface used by DeviceCommandScreenshotJob to retrieve its |
| 60 // dependencies. | 60 // dependencies. |
| 61 class Delegate { | 61 class Delegate { |
| 62 public: | 62 public: |
| 63 virtual ~Delegate() {} | 63 virtual ~Delegate() {} |
| 64 | 64 |
| 65 // Returns true if screenshots are allowed in this session. Returns false |
| 66 // if the current session is not an auto-launched kiosk session, or there |
| 67 // have been certain types of user input that may result in leaking private |
| 68 // information. |
| 69 virtual bool IsScreenshotAllowed() = 0; |
| 70 |
| 65 // Acquires a snapshot of |source_rect| in |window| and invokes |callback| | 71 // Acquires a snapshot of |source_rect| in |window| and invokes |callback| |
| 66 // with the PNG data. The passed-in callback will not be invoked after the | 72 // with the PNG data. The passed-in callback will not be invoked after the |
| 67 // delegate has been destroyed. See e.g. ScreenshotDelegate. | 73 // delegate has been destroyed. See e.g. ScreenshotDelegate. |
| 68 virtual void TakeSnapshot( | 74 virtual void TakeSnapshot( |
| 69 gfx::NativeWindow window, | 75 gfx::NativeWindow window, |
| 70 const gfx::Rect& source_rect, | 76 const gfx::Rect& source_rect, |
| 71 const ui::GrabWindowSnapshotAsyncPNGCallback& callback) = 0; | 77 const ui::GrabWindowSnapshotAsyncPNGCallback& callback) = 0; |
| 72 | 78 |
| 73 // Creates a new fully configured instance of an UploadJob. This method | 79 // Creates a new fully configured instance of an UploadJob. This method |
| 74 // may be called any number of times. | 80 // may be called any number of times. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 scoped_ptr<UploadJob> upload_job_; | 130 scoped_ptr<UploadJob> upload_job_; |
| 125 | 131 |
| 126 base::WeakPtrFactory<DeviceCommandScreenshotJob> weak_ptr_factory_; | 132 base::WeakPtrFactory<DeviceCommandScreenshotJob> weak_ptr_factory_; |
| 127 | 133 |
| 128 DISALLOW_COPY_AND_ASSIGN(DeviceCommandScreenshotJob); | 134 DISALLOW_COPY_AND_ASSIGN(DeviceCommandScreenshotJob); |
| 129 }; | 135 }; |
| 130 | 136 |
| 131 } // namespace policy | 137 } // namespace policy |
| 132 | 138 |
| 133 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SCREENS
HOT_JOB_H_ | 139 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SCREENS
HOT_JOB_H_ |
| OLD | NEW |