keyboard_backlight_toggle_controller.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2021 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_KEYBOARD_BRIGHTNESS_KEYBOARD_BACKLIGHT_TOGGLE_CONTROLLER_H_
  5. #define ASH_SYSTEM_KEYBOARD_BRIGHTNESS_KEYBOARD_BACKLIGHT_TOGGLE_CONTROLLER_H_
  6. #include "ash/system/unified/unified_slider_view.h"
  7. namespace ash {
  8. class UnifiedSystemTrayModel;
  9. // Controller of a toast showing enable/disable of keyboard backlight.
  10. class KeyboardBacklightToggleController : public UnifiedSliderListener {
  11. public:
  12. explicit KeyboardBacklightToggleController(UnifiedSystemTrayModel* model);
  13. KeyboardBacklightToggleController(const KeyboardBacklightToggleController&) =
  14. delete;
  15. KeyboardBacklightToggleController& operator=(
  16. const KeyboardBacklightToggleController&) = delete;
  17. ~KeyboardBacklightToggleController() override;
  18. // UnifiedSliderListener:
  19. views::View* CreateView() override;
  20. void SliderValueChanged(views::Slider* sender,
  21. float value,
  22. float old_value,
  23. views::SliderChangeReason reason) override;
  24. private:
  25. UnifiedSystemTrayModel* const model_;
  26. UnifiedSliderView* slider_ = nullptr;
  27. };
  28. } // namespace ash
  29. #endif // ASH_SYSTEM_KEYBOARD_BRIGHTNESS_KEYBOARD_BACKLIGHT_TOGGLE_CONTROLLER_H_