unified_volume_view.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2018 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 ASH_SYSTEM_AUDIO_UNIFIED_VOLUME_VIEW_H_
  5. #define ASH_SYSTEM_AUDIO_UNIFIED_VOLUME_VIEW_H_
  6. #include "ash/system/audio/unified_volume_slider_controller.h"
  7. #include "ash/system/unified/unified_slider_view.h"
  8. #include "chromeos/ash/components/audio/cras_audio_handler.h"
  9. namespace ash {
  10. // View of a slider that can change audio volume.
  11. class UnifiedVolumeView : public UnifiedSliderView,
  12. public CrasAudioHandler::AudioObserver {
  13. public:
  14. UnifiedVolumeView(UnifiedVolumeSliderController* controller,
  15. UnifiedVolumeSliderController::Delegate* delegate);
  16. UnifiedVolumeView(const UnifiedVolumeView&) = delete;
  17. UnifiedVolumeView& operator=(const UnifiedVolumeView&) = delete;
  18. ~UnifiedVolumeView() override;
  19. // views::View:
  20. const char* GetClassName() const override;
  21. private:
  22. void Update(bool by_user);
  23. // CrasAudioHandler::AudioObserver:
  24. void OnOutputNodeVolumeChanged(uint64_t node_id, int volume) override;
  25. void OnOutputMuteChanged(bool mute_on) override;
  26. void OnAudioNodesChanged() override;
  27. void OnActiveOutputNodeChanged() override;
  28. void OnActiveInputNodeChanged() override;
  29. // UnifiedSliderView:
  30. void ChildVisibilityChanged(views::View* child) override;
  31. views::Button* const more_button_;
  32. };
  33. } // namespace ash
  34. #endif // ASH_SYSTEM_AUDIO_UNIFIED_VOLUME_VIEW_H_