OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SET_VOLUME _JOB_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SET_VOLUME _JOB_H_ | |
7 | |
8 #include <memory> | |
9 #include <string> | |
10 | |
11 #include "base/macros.h" | |
12 #include "components/policy/core/common/remote_commands/remote_command_job.h" | |
13 | |
14 namespace policy { | |
15 | |
16 class DeviceCommandSetVolumeJob : public RemoteCommandJob { | |
17 public: | |
18 // Cras delegate used for setting the output volume. | |
19 class CrasDelegate { | |
20 public: | |
21 virtual ~CrasDelegate(); | |
22 virtual void SetOutputVolumePercent(int volume_percent); | |
Andrew T Wilson (Slow)
2017/03/07 11:45:14
I'm guessing you only need this for testing, since
Ivan Šandrk
2017/03/07 16:15:31
Good suggestion, thanks.
| |
23 }; | |
24 | |
25 explicit DeviceCommandSetVolumeJob( | |
26 std::unique_ptr<CrasDelegate> cras_delegate); | |
27 ~DeviceCommandSetVolumeJob() override; | |
28 | |
29 // RemoteCommandJob: | |
30 enterprise_management::RemoteCommand_Type GetType() const override; | |
31 | |
32 private: | |
33 // RemoteCommandJob: | |
Andrew T Wilson (Slow)
2017/03/07 11:45:14
In general, if you are publicly deriving from Remo
Ivan Šandrk
2017/03/07 16:15:31
Hm I followed what Chris was doing in the older co
| |
34 bool IsExpired(base::TimeTicks now) override; | |
35 bool ParseCommandPayload(const std::string& command_payload) override; | |
36 void RunImpl(const CallbackWithResult& succeeded_callback, | |
37 const CallbackWithResult& failed_callback) override; | |
38 base::TimeDelta GetCommmandTimeout() const override; | |
39 | |
40 int volume_; | |
Andrew T Wilson (Slow)
2017/03/07 11:45:14
Explain what this is - a value from 0-100, I guess
Ivan Šandrk
2017/03/07 16:15:31
Done.
| |
41 | |
42 std::unique_ptr<CrasDelegate> cras_delegate_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(DeviceCommandSetVolumeJob); | |
45 }; | |
46 | |
47 } // namespace policy | |
48 | |
49 #endif // CHROME_BROWSER_CHROMEOS_POLICY_REMOTE_COMMANDS_DEVICE_COMMAND_SET_VOL UME_JOB_H_ | |
OLD | NEW |