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