| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 namespace chromeos { | 9 namespace chromeos { |
| 10 | 10 |
| 11 class BrightnessLibrary { | 11 class BrightnessLibrary { |
| 12 public: | 12 public: |
| 13 class Observer { | 13 class Observer { |
| 14 public: | 14 public: |
| 15 virtual void BrightnessChanged(int level, bool user_initiated) = 0; | 15 virtual void BrightnessChanged(int level, bool user_initiated) = 0; |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 virtual ~BrightnessLibrary() {} | 18 virtual ~BrightnessLibrary() {} |
| 19 | 19 |
| 20 virtual void Init() = 0; |
| 21 |
| 22 virtual void AddObserver(Observer* observer) = 0; |
| 23 virtual void RemoveObserver(Observer* observer) = 0; |
| 24 |
| 20 virtual void DecreaseScreenBrightness(bool allow_off) = 0; | 25 virtual void DecreaseScreenBrightness(bool allow_off) = 0; |
| 21 virtual void IncreaseScreenBrightness() = 0; | 26 virtual void IncreaseScreenBrightness() = 0; |
| 22 | 27 |
| 23 virtual void AddObserver(Observer* observer) = 0; | |
| 24 virtual void RemoveObserver(Observer* observer) = 0; | |
| 25 | |
| 26 // Factory function, creates a new instance and returns ownership. | 28 // Factory function, creates a new instance and returns ownership. |
| 27 // For normal usage, access the singleton via CrosLibrary::Get(). | 29 // For normal usage, access the singleton via CrosLibrary::Get(). |
| 28 static BrightnessLibrary* GetImpl(bool stub); | 30 static BrightnessLibrary* GetImpl(bool stub); |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 } // namespace chromeos | 33 } // namespace chromeos |
| 32 | 34 |
| 33 #endif // CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ | 35 #endif // CHROME_BROWSER_CHROMEOS_CROS_BRIGHTNESS_LIBRARY_H_ |
| OLD | NEW |