shell_audio_controller_chromeos.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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
  3. // found in the LICENSE file.
  4. #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_
  5. #define EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_
  6. #include <stdint.h>
  7. #include "chromeos/ash/components/audio/cras_audio_handler.h"
  8. namespace extensions {
  9. // Ensures that the "best" input and output audio devices are always active.
  10. class ShellAudioController : public ash::CrasAudioHandler::AudioObserver {
  11. public:
  12. ShellAudioController();
  13. ShellAudioController(const ShellAudioController&) = delete;
  14. ShellAudioController& operator=(const ShellAudioController&) = delete;
  15. ~ShellAudioController() override;
  16. // ash::CrasAudioHandler::Observer implementation:
  17. void OnAudioNodesChanged() override;
  18. private:
  19. // Gets the current device list from CRAS, chooses the best input and output
  20. // device, and activates them if they aren't already active.
  21. void ActivateDevices();
  22. };
  23. } // namespace extensions
  24. #endif // EXTENSIONS_SHELL_BROWSER_SHELL_AUDIO_CONTROLLER_CHROMEOS_H_