Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 virtual ~Observer() {} | 54 virtual ~Observer() {} |
| 55 | 55 |
| 56 // Called if the power manager process restarts. | 56 // Called if the power manager process restarts. |
| 57 virtual void PowerManagerRestarted() {} | 57 virtual void PowerManagerRestarted() {} |
| 58 | 58 |
| 59 // Called when the brightness is changed. | 59 // Called when the brightness is changed. |
| 60 // |level| is of the range [0, 100]. | 60 // |level| is of the range [0, 100]. |
| 61 // |user_initiated| is true if the action is initiated by the user. | 61 // |user_initiated| is true if the action is initiated by the user. |
| 62 virtual void BrightnessChanged(int level, bool user_initiated) {} | 62 virtual void BrightnessChanged(int level, bool user_initiated) {} |
| 63 | 63 |
| 64 // Noitify android setting about brightness change | |
|
Muyuan
2017/04/05 18:41:08
dbus/power_manager_client is pretty general and it
yueli
2017/04/05 19:59:46
Done.
| |
| 65 virtual void NotifyBrightnessChange(double brightness) {} | |
|
Muyuan
2017/04/05 18:41:08
This function is probably not needed. You can over
yueli
2017/04/05 19:59:46
Done.
| |
| 66 | |
| 64 // Called when peripheral device battery status is received. | 67 // Called when peripheral device battery status is received. |
| 65 // |path| is the sysfs path for the battery of the peripheral device. | 68 // |path| is the sysfs path for the battery of the peripheral device. |
| 66 // |name| is the human readble name of the device. | 69 // |name| is the human readble name of the device. |
| 67 // |level| within [0, 100] represents the device battery level and -1 | 70 // |level| within [0, 100] represents the device battery level and -1 |
| 68 // means an unknown level or device is disconnected. | 71 // means an unknown level or device is disconnected. |
| 69 virtual void PeripheralBatteryStatusReceived(const std::string& path, | 72 virtual void PeripheralBatteryStatusReceived(const std::string& path, |
| 70 const std::string& name, | 73 const std::string& name, |
| 71 int level) {} | 74 int level) {} |
| 72 | 75 |
| 73 // Called when updated information about the power supply is available. | 76 // Called when updated information about the power supply is available. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 // Set the screen brightness to |percent|, in the range [0.0, 100.0]. | 161 // Set the screen brightness to |percent|, in the range [0.0, 100.0]. |
| 159 // If |gradual| is true, the transition will be animated. | 162 // If |gradual| is true, the transition will be animated. |
| 160 virtual void SetScreenBrightnessPercent(double percent, bool gradual) = 0; | 163 virtual void SetScreenBrightnessPercent(double percent, bool gradual) = 0; |
| 161 | 164 |
| 162 // Asynchronously gets the current screen brightness, in the range | 165 // Asynchronously gets the current screen brightness, in the range |
| 163 // [0.0, 100.0]. On error (e.g. powerd not running), |callback| will not be | 166 // [0.0, 100.0]. On error (e.g. powerd not running), |callback| will not be |
| 164 // run. | 167 // run. |
| 165 virtual void GetScreenBrightnessPercent( | 168 virtual void GetScreenBrightnessPercent( |
| 166 const GetScreenBrightnessPercentCallback& callback) = 0; | 169 const GetScreenBrightnessPercentCallback& callback) = 0; |
| 167 | 170 |
| 171 // Get the current screen brightness and syncrhonize it to android settings | |
| 172 virtual void SyncScreenBrightness() = 0; | |
| 173 | |
| 168 // Decreases the keyboard brightness. | 174 // Decreases the keyboard brightness. |
| 169 virtual void DecreaseKeyboardBrightness() = 0; | 175 virtual void DecreaseKeyboardBrightness() = 0; |
| 170 | 176 |
| 171 // Increases the keyboard brightness. | 177 // Increases the keyboard brightness. |
| 172 virtual void IncreaseKeyboardBrightness() = 0; | 178 virtual void IncreaseKeyboardBrightness() = 0; |
| 173 | 179 |
| 174 // Requests an updated copy of the power status. Observer::PowerChanged() | 180 // Requests an updated copy of the power status. Observer::PowerChanged() |
| 175 // will be called asynchronously. | 181 // will be called asynchronously. |
| 176 virtual void RequestStatusUpdate() = 0; | 182 virtual void RequestStatusUpdate() = 0; |
| 177 | 183 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 // Create() should be used instead. | 244 // Create() should be used instead. |
| 239 PowerManagerClient(); | 245 PowerManagerClient(); |
| 240 | 246 |
| 241 private: | 247 private: |
| 242 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 248 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 243 }; | 249 }; |
| 244 | 250 |
| 245 } // namespace chromeos | 251 } // namespace chromeos |
| 246 | 252 |
| 247 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 253 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |