OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ | 5 #ifndef ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ |
6 #define ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ | 6 #define ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // Emitted when the NightLight status is changed. | 28 // Emitted when the NightLight status is changed. |
29 virtual void OnNightLightEnabledChanged(bool enabled) = 0; | 29 virtual void OnNightLightEnabledChanged(bool enabled) = 0; |
30 | 30 |
31 protected: | 31 protected: |
32 virtual ~Observer() {} | 32 virtual ~Observer() {} |
33 }; | 33 }; |
34 | 34 |
35 explicit NightLightController(SessionController* session_controller); | 35 explicit NightLightController(SessionController* session_controller); |
36 ~NightLightController() override; | 36 ~NightLightController() override; |
37 | 37 |
| 38 // Returns true if the NightLight feature is enabled in the flags. |
| 39 static bool IsFeatureEnabled(); |
| 40 |
38 static void RegisterPrefs(PrefRegistrySimple* registry); | 41 static void RegisterPrefs(PrefRegistrySimple* registry); |
39 | 42 |
40 void AddObserver(Observer* observer); | 43 void AddObserver(Observer* observer); |
41 void RemoveObserver(Observer* observer); | 44 void RemoveObserver(Observer* observer); |
42 | 45 |
43 // Get the NightLight settings stored in the current active user prefs. | 46 // Get the NightLight settings stored in the current active user prefs. |
44 bool GetEnabled() const; | 47 bool GetEnabled() const; |
45 float GetColorTemperature() const; | 48 float GetColorTemperature() const; |
46 | 49 |
47 // Set the desired NightLight settings in the current active user prefs. | 50 // Set the desired NightLight settings in the current active user prefs. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; | 86 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
84 | 87 |
85 base::ObserverList<Observer> observers_; | 88 base::ObserverList<Observer> observers_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(NightLightController); | 90 DISALLOW_COPY_AND_ASSIGN(NightLightController); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace ash | 93 } // namespace ash |
91 | 94 |
92 #endif // ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ | 95 #endif // ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_CONTROLLER_H_ |
OLD | NEW |