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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_REBOOT_JOB_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_REBOOT_JOB_H_
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/timer/timer.h"
11 #include "components/policy/core/common/remote_commands/remote_command_job.h"
15 class PowerManagerClient
;
17 } // namespace chromeos
21 class DeviceCommandRebootJob
: public RemoteCommandJob
{
23 explicit DeviceCommandRebootJob(
24 chromeos::PowerManagerClient
* power_manager_client
);
25 ~DeviceCommandRebootJob() override
;
28 enterprise_management::RemoteCommand_Type
GetType() const override
;
32 bool IsExpired(base::TimeTicks now
) override
;
33 void RunImpl(const CallbackWithResult
& succeeded_callback
,
34 const CallbackWithResult
& failed_callback
) override
;
35 void TerminateImpl() override
;
36 base::TimeDelta
GetCommmandTimeout() const override
;
40 chromeos::PowerManagerClient
* power_manager_client_
;
42 base::OneShotTimer
<DeviceCommandRebootJob
> reboot_timer_
;
44 base::WeakPtrFactory
<DeviceCommandRebootJob
> weak_ptr_factory_
;
46 DISALLOW_COPY_AND_ASSIGN(DeviceCommandRebootJob
);
51 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_REBOOT_JOB_H_