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 #include "chrome/browser/chromeos/policy/remote_commands/device_commands_factory
_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/remote_commands/device_commands_factory
_chromeos.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
11 #include "chrome/browser/chromeos/policy/remote_commands/device_command_reboot_j
ob.h" | 11 #include "chrome/browser/chromeos/policy/remote_commands/device_command_reboot_j
ob.h" |
12 #include "chrome/browser/chromeos/policy/remote_commands/device_command_screensh
ot_job.h" | 12 #include "chrome/browser/chromeos/policy/remote_commands/device_command_screensh
ot_job.h" |
| 13 #include "chrome/browser/chromeos/policy/remote_commands/device_command_set_volu
me_job.h" |
13 #include "chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h" | 14 #include "chrome/browser/chromeos/policy/remote_commands/screenshot_delegate.h" |
14 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
15 #include "components/policy/core/common/remote_commands/remote_command_job.h" | 16 #include "components/policy/core/common/remote_commands/remote_command_job.h" |
16 #include "components/policy/proto/device_management_backend.pb.h" | 17 #include "components/policy/proto/device_management_backend.pb.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 | 19 |
19 namespace em = enterprise_management; | 20 namespace em = enterprise_management; |
20 | 21 |
21 namespace policy { | 22 namespace policy { |
22 | 23 |
23 DeviceCommandsFactoryChromeOS::DeviceCommandsFactoryChromeOS() { | 24 DeviceCommandsFactoryChromeOS::DeviceCommandsFactoryChromeOS() { |
24 } | 25 } |
25 | 26 |
26 DeviceCommandsFactoryChromeOS::~DeviceCommandsFactoryChromeOS() { | 27 DeviceCommandsFactoryChromeOS::~DeviceCommandsFactoryChromeOS() { |
27 } | 28 } |
28 | 29 |
29 std::unique_ptr<RemoteCommandJob> | 30 std::unique_ptr<RemoteCommandJob> |
30 DeviceCommandsFactoryChromeOS::BuildJobForType(em::RemoteCommand_Type type) { | 31 DeviceCommandsFactoryChromeOS::BuildJobForType(em::RemoteCommand_Type type) { |
31 switch (type) { | 32 switch (type) { |
32 case em::RemoteCommand_Type_DEVICE_REBOOT: | 33 case em::RemoteCommand_Type_DEVICE_REBOOT: |
33 return base::WrapUnique<RemoteCommandJob>(new DeviceCommandRebootJob( | 34 return base::WrapUnique<RemoteCommandJob>(new DeviceCommandRebootJob( |
34 chromeos::DBusThreadManager::Get()->GetPowerManagerClient())); | 35 chromeos::DBusThreadManager::Get()->GetPowerManagerClient())); |
35 case em::RemoteCommand_Type_DEVICE_SCREENSHOT: | 36 case em::RemoteCommand_Type_DEVICE_SCREENSHOT: |
36 return base::WrapUnique<RemoteCommandJob>( | 37 return base::WrapUnique<RemoteCommandJob>( |
37 new DeviceCommandScreenshotJob(base::MakeUnique<ScreenshotDelegate>( | 38 new DeviceCommandScreenshotJob(base::MakeUnique<ScreenshotDelegate>( |
38 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 39 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( |
39 content::BrowserThread::GetBlockingPool() | 40 content::BrowserThread::GetBlockingPool() |
40 ->GetSequenceToken())))); | 41 ->GetSequenceToken())))); |
| 42 case em::RemoteCommand_Type_DEVICE_SET_VOLUME: |
| 43 return base::WrapUnique<RemoteCommandJob>( |
| 44 new DeviceCommandSetVolumeJob()); |
41 default: | 45 default: |
42 return nullptr; | 46 return nullptr; |
43 } | 47 } |
44 } | 48 } |
45 | 49 |
46 } // namespace policy | 50 } // namespace policy |
OLD | NEW |