| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chromeos/audio/cras_audio_handler.h" | 9 #include "chromeos/audio/cras_audio_handler.h" |
| 10 | 10 |
| 11 namespace extensions { | 11 namespace extensions { |
| 12 | 12 |
| 13 // Ensures that the "best" input and output audio devices are always active. | 13 // Ensures that the "best" input and output audio devices are always active. |
| 14 class ShellAudioController : public chromeos::CrasAudioHandler::AudioObserver { | 14 class ShellAudioController : public chromeos::CrasAudioHandler::AudioObserver { |
| 15 public: | 15 public: |
| 16 ShellAudioController(); | 16 ShellAudioController(); |
| 17 virtual ~ShellAudioController(); | 17 ~ShellAudioController() override; |
| 18 | 18 |
| 19 // chromeos::CrasAudioHandler::Observer implementation: | 19 // chromeos::CrasAudioHandler::Observer implementation: |
| 20 void OnOutputVolumeChanged() override; | 20 void OnOutputVolumeChanged() override; |
| 21 void OnOutputMuteChanged() override; | 21 void OnOutputMuteChanged() override; |
| 22 void OnInputGainChanged() override; | 22 void OnInputGainChanged() override; |
| 23 void OnInputMuteChanged() override; | 23 void OnInputMuteChanged() override; |
| 24 void OnAudioNodesChanged() override; | 24 void OnAudioNodesChanged() override; |
| 25 void OnActiveOutputNodeChanged() override; | 25 void OnActiveOutputNodeChanged() override; |
| 26 void OnActiveInputNodeChanged() override; | 26 void OnActiveInputNodeChanged() override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 // Gets the current device list from CRAS, chooses the best input and output | 29 // Gets the current device list from CRAS, chooses the best input and output |
| 30 // device, and activates them if they aren't already active. | 30 // device, and activates them if they aren't already active. |
| 31 void ActivateDevices(); | 31 void ActivateDevices(); |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(ShellAudioController); | 33 DISALLOW_COPY_AND_ASSIGN(ShellAudioController); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace extensions | 36 } // namespace extensions |
| 37 | 37 |
| 38 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ | 38 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_ |
| OLD | NEW |