Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/chromeos/policy/remote_commands/device_command_set_volume_job.h

Issue 2733903002: Remote set volume command (Closed)
Patch Set: Nits + mute/unmute logic Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/callback_forward.h"
12 #include "base/macros.h"
13 #include "components/policy/core/common/remote_commands/remote_command_job.h"
14
15 namespace policy {
16
17 class DeviceCommandSetVolumeJob : public RemoteCommandJob {
18 public:
19 using VolumeCallback = base::Callback<void(int)>;
20
21 DeviceCommandSetVolumeJob();
22 ~DeviceCommandSetVolumeJob() override;
23
24 void SetVolumeCallbackForTesting(const VolumeCallback& callback);
25
26 // RemoteCommandJob:
27 enterprise_management::RemoteCommand_Type GetType() const override;
28 base::TimeDelta GetCommmandTimeout() const override;
29
30 protected:
31 // RemoteCommandJob:
32 bool ParseCommandPayload(const std::string& command_payload) override;
33 bool IsExpired(base::TimeTicks now) override;
34 void RunImpl(const CallbackWithResult& succeeded_callback,
35 const CallbackWithResult& failed_callback) override;
36
37 private:
38 // New volume level to be set, value in range [0,100].
39 int volume_;
40
41 // Used in tests instead of CrasAudioHandler::SetOutputVolumePercent.
42 VolumeCallback volume_callback_;
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_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/policy/remote_commands/device_command_set_volume_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698