1 // Copyright 2020 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 
5 #ifndef ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
6 #define ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
7 
8 #include "ash/ash_export.h"
9 #include "ash/system/unified/unified_slider_view.h"
10 #include "base/callback_forward.h"
11 
12 namespace ash {
13 
14 class MicGainSliderView;
15 
16 // Controller for mic gain sliders situated in audio detailed
17 // view in the system tray.
18 class ASH_EXPORT MicGainSliderController : public UnifiedSliderListener {
19  public:
20   MicGainSliderController();
21   ~MicGainSliderController() override;
22 
23   // Create a slider view for a specific input device.
24   std::unique_ptr<MicGainSliderView> CreateMicGainSlider(uint64_t device_id,
25                                                          bool internal);
26 
27   using MapDeviceSliderCallback =
28       base::RepeatingCallback<void(uint64_t, views::View*)>;
29   static void SetMapDeviceSliderCallbackForTest(
30       MapDeviceSliderCallback* test_slider_device_callback);
31 
32   // UnifiedSliderListener:
33   views::View* CreateView() override;
34   void SliderValueChanged(views::Slider* sender,
35                           float value,
36                           float old_value,
37                           views::SliderChangeReason reason) override;
38 
39   void SliderButtonPressed();
40 };
41 
42 }  // namespace ash
43 
44 #endif  // ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
45