unified_brightness_view.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_BRIGHTNESS_UNIFIED_BRIGHTNESS_VIEW_H_
  5. #define ASH_SYSTEM_BRIGHTNESS_UNIFIED_BRIGHTNESS_VIEW_H_
  6. #include "ash/system/unified/unified_slider_view.h"
  7. #include "ash/system/unified/unified_system_tray_model.h"
  8. #include "base/memory/scoped_refptr.h"
  9. namespace ash {
  10. class UnifiedBrightnessSliderController;
  11. // View of a slider that can change display brightness. It observes current
  12. // brightness level from UnifiedSystemTrayModel.
  13. class UnifiedBrightnessView : public UnifiedSliderView,
  14. public UnifiedSystemTrayModel::Observer {
  15. public:
  16. UnifiedBrightnessView(UnifiedBrightnessSliderController* controller,
  17. scoped_refptr<UnifiedSystemTrayModel> model);
  18. UnifiedBrightnessView(const UnifiedBrightnessView&) = delete;
  19. UnifiedBrightnessView& operator=(const UnifiedBrightnessView&) = delete;
  20. ~UnifiedBrightnessView() override;
  21. // UnifiedSystemTrayModel::Observer:
  22. void OnDisplayBrightnessChanged(bool by_user) override;
  23. // views::View:
  24. const char* GetClassName() const override;
  25. void OnThemeChanged() override;
  26. private:
  27. scoped_refptr<UnifiedSystemTrayModel> model_;
  28. };
  29. } // namespace ash
  30. #endif // ASH_SYSTEM_BRIGHTNESS_UNIFIED_BRIGHTNESS_VIEW_H_