OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ |
6 #define CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include "ash/public/interfaces/volume.mojom.h" |
| 9 #include "base/macros.h" |
| 10 #include "mojo/public/cpp/bindings/binding_set.h" |
9 | 11 |
10 #include "ash/common/system/volume_control_delegate.h" | 12 // Controls the volume when F8-10 or a multimedia key for volume is pressed. |
11 #include "base/compiler_specific.h" | 13 class VolumeController : public ash::mojom::VolumeController { |
12 #include "base/macros.h" | |
13 #include "chromeos/audio/cras_audio_handler.h" | |
14 #include "ui/base/accelerators/accelerator.h" | |
15 | |
16 // A class which controls volume when F8-10 or a multimedia key for volume is | |
17 // pressed. | |
18 class VolumeController : public ash::VolumeControlDelegate, | |
19 public chromeos::CrasAudioHandler::AudioObserver { | |
20 public: | 14 public: |
21 VolumeController(); | 15 VolumeController(); |
22 ~VolumeController() override; | 16 ~VolumeController() override; |
23 | 17 |
24 // Overridden from ash::VolumeControlDelegate: | 18 // Binds the mojom::VolumeController interface request to this object. |
25 void HandleVolumeMute(const ui::Accelerator& accelerator) override; | 19 void BindRequest(ash::mojom::VolumeControllerRequest request); |
26 void HandleVolumeDown(const ui::Accelerator& accelerator) override; | |
27 void HandleVolumeUp(const ui::Accelerator& accelerator) override; | |
28 | 20 |
29 // Overridden from chromeos::CrasAudioHandler::AudioObserver. | 21 // Overridden from ash::mojom::VolumeController: |
30 void OnOutputNodeVolumeChanged(uint64_t node_id, int volume) override; | 22 void VolumeMute() override; |
31 void OnOutputMuteChanged(bool mute_on, bool system_adjust) override; | 23 void VolumeDown() override; |
| 24 void VolumeUp() override; |
32 | 25 |
33 private: | 26 private: |
| 27 mojo::BindingSet<ash::mojom::VolumeController> bindings_; |
34 | 28 |
35 DISALLOW_COPY_AND_ASSIGN(VolumeController); | 29 DISALLOW_COPY_AND_ASSIGN(VolumeController); |
36 }; | 30 }; |
37 | 31 |
38 #endif // CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ | 32 #endif // CHROME_BROWSER_UI_ASH_VOLUME_CONTROLLER_CHROMEOS_H_ |
OLD | NEW |