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

Side by Side Diff: chrome/browser/ui/ash/volume_controller_chromeos.h

Issue 2427913003: Use mojo volume interfaces for mash and classic ash. (Closed)
Patch Set: Split volume and system events observers; only hook up volume. Created 4 years, 2 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
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_
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/volume_controller_browsertest_chromeos.cc ('k') | chrome/browser/ui/ash/volume_controller_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698