| 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/task_scheduler/post_task.h" | 10 #include "base/task_scheduler/post_task.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 std::unique_ptr<RemoteCommandJob> | 30 std::unique_ptr<RemoteCommandJob> |
| 31 DeviceCommandsFactoryChromeOS::BuildJobForType(em::RemoteCommand_Type type) { | 31 DeviceCommandsFactoryChromeOS::BuildJobForType(em::RemoteCommand_Type type) { |
| 32 switch (type) { | 32 switch (type) { |
| 33 case em::RemoteCommand_Type_DEVICE_REBOOT: | 33 case em::RemoteCommand_Type_DEVICE_REBOOT: |
| 34 return base::WrapUnique<RemoteCommandJob>(new DeviceCommandRebootJob( | 34 return base::WrapUnique<RemoteCommandJob>(new DeviceCommandRebootJob( |
| 35 chromeos::DBusThreadManager::Get()->GetPowerManagerClient())); | 35 chromeos::DBusThreadManager::Get()->GetPowerManagerClient())); |
| 36 case em::RemoteCommand_Type_DEVICE_SCREENSHOT: | 36 case em::RemoteCommand_Type_DEVICE_SCREENSHOT: |
| 37 return base::WrapUnique<RemoteCommandJob>( | 37 return base::WrapUnique<RemoteCommandJob>( |
| 38 new DeviceCommandScreenshotJob(base::MakeUnique<ScreenshotDelegate>( | 38 new DeviceCommandScreenshotJob(base::MakeUnique<ScreenshotDelegate>( |
| 39 base::CreateSequencedTaskRunnerWithTraits( | 39 base::CreateSequencedTaskRunnerWithTraits( |
| 40 base::TaskTraits() | 40 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 41 .MayBlock() | 41 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})))); |
| 42 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 43 .WithShutdownBehavior( | |
| 44 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN))))); | |
| 45 case em::RemoteCommand_Type_DEVICE_SET_VOLUME: | 42 case em::RemoteCommand_Type_DEVICE_SET_VOLUME: |
| 46 return base::WrapUnique<RemoteCommandJob>( | 43 return base::WrapUnique<RemoteCommandJob>( |
| 47 new DeviceCommandSetVolumeJob()); | 44 new DeviceCommandSetVolumeJob()); |
| 48 case em::RemoteCommand_Type_DEVICE_FETCH_STATUS: | 45 case em::RemoteCommand_Type_DEVICE_FETCH_STATUS: |
| 49 return base::WrapUnique<RemoteCommandJob>( | 46 return base::WrapUnique<RemoteCommandJob>( |
| 50 new DeviceCommandFetchStatusJob()); | 47 new DeviceCommandFetchStatusJob()); |
| 51 default: | 48 default: |
| 52 return nullptr; | 49 return nullptr; |
| 53 } | 50 } |
| 54 } | 51 } |
| 55 | 52 |
| 56 } // namespace policy | 53 } // namespace policy |
| OLD | NEW |