Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / chromeos / policy / remote_commands / device_commands_factory_chromeos.cc
blobae77c1676bafd4d67cc7b880051bf8085f406a00
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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/policy/remote_commands/device_commands_factory_chromeos.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "base/threading/sequenced_worker_pool.h"
9 #include "chrome/browser/chromeos/policy/remote_commands/device_command_reboot_job.h"
10 #include "chrome/browser/chromeos/policy/remote_commands/device_command_screenshot_job.h"
11 #include "chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h"
12 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "components/policy/core/common/remote_commands/remote_command_job.h"
14 #include "content/public/browser/browser_thread.h"
15 #include "policy/proto/device_management_backend.pb.h"
17 namespace em = enterprise_management;
19 namespace policy {
21 DeviceCommandsFactoryChromeOS::DeviceCommandsFactoryChromeOS() {
24 DeviceCommandsFactoryChromeOS::~DeviceCommandsFactoryChromeOS() {
27 scoped_ptr<RemoteCommandJob> DeviceCommandsFactoryChromeOS::BuildJobForType(
28 em::RemoteCommand_Type type) {
29 switch (type) {
30 case em::RemoteCommand_Type_DEVICE_REBOOT:
31 return make_scoped_ptr<RemoteCommandJob>(new DeviceCommandRebootJob(
32 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()));
33 case em::RemoteCommand_Type_DEVICE_SCREENSHOT:
34 return make_scoped_ptr<RemoteCommandJob>(
35 new DeviceCommandScreenshotJob(make_scoped_ptr(new ScreenshotDelegate(
36 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
37 content::BrowserThread::GetBlockingPool()
38 ->GetSequenceToken())))));
39 default:
40 return nullptr;
44 } // namespace policy