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

Unified Diff: chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
diff --git a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
index bcb1ffc7ab3bad070152805a0f1c11f72092d430..11eb49eb70113c6b5f3a412fe72d1aa158535667 100644
--- a/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
+++ b/chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.cc
@@ -190,8 +190,13 @@ void DeviceCommandScreenshotJob::RunImpl(
succeeded_callback_ = succeeded_callback;
failed_callback_ = failed_callback;
- upload_job_ = screenshot_delegate_->CreateUploadJob(upload_url_, this);
- DCHECK(upload_job_);
+ // Fail if the delegate says screenshots are not allowed in this session.
+ if (!screenshot_delegate_->IsScreenshotAllowed()) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(failed_callback_, base::Passed(make_scoped_ptr(
+ new Payload(FAILURE_USER_INPUT)))));
+ }
aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows();
@@ -203,6 +208,9 @@ void DeviceCommandScreenshotJob::RunImpl(
FAILURE_SCREENSHOT_ACQUISITION)))));
}
+ upload_job_ = screenshot_delegate_->CreateUploadJob(upload_url_, this);
+ DCHECK(upload_job_);
+
// Post tasks to the sequenced worker pool for taking screenshots on each
// attached screen.
num_pending_screenshots_ = root_windows.size();

Powered by Google App Engine
This is Rietveld 408576698