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

Unified Diff: chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.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: Fixed leak in test. 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_commands_factory_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.cc b/chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.cc
index ae77c1676bafd4d67cc7b880051bf8085f406a00..56b8805ff1a70c6fa71d1779614bad9d11173124 100644
--- a/chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.cc
+++ b/chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.cc
@@ -6,6 +6,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/threading/sequenced_worker_pool.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/remote_commands/device_command_reboot_job.h"
#include "chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h"
#include "chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h"
@@ -30,12 +32,17 @@ scoped_ptr<RemoteCommandJob> DeviceCommandsFactoryChromeOS::BuildJobForType(
case em::RemoteCommand_Type_DEVICE_REBOOT:
return make_scoped_ptr<RemoteCommandJob>(new DeviceCommandRebootJob(
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()));
- case em::RemoteCommand_Type_DEVICE_SCREENSHOT:
- return make_scoped_ptr<RemoteCommandJob>(
- new DeviceCommandScreenshotJob(make_scoped_ptr(new ScreenshotDelegate(
- content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
- content::BrowserThread::GetBlockingPool()
- ->GetSequenceToken())))));
+ case em::RemoteCommand_Type_DEVICE_SCREENSHOT: {
+ scoped_refptr<base::TaskRunner> task_runner =
+ content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
+ content::BrowserThread::GetBlockingPool()->GetSequenceToken());
+ BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos();
cschuet (SLOW) 2015/05/13 15:56:09 DCHECK(connector)?
Andrew T Wilson (Slow) 2015/05/15 09:43:51 No need, we'll just crash if it's null, which is e
+ return make_scoped_ptr<RemoteCommandJob>(new DeviceCommandScreenshotJob(
+ make_scoped_ptr(new ScreenshotDelegate(task_runner)),
+ connector->GetDeviceCloudPolicyManager()->GetStatusUploader()));
+ }
cschuet (SLOW) 2015/05/13 15:56:09 Thanks for cleaning that up. That was a little too
Andrew T Wilson (Slow) 2015/05/15 09:43:51 Hah, and I reverted back to the original since now
default:
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698