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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Callback used for getting the current screen brightness. The param is in the | 32 // Callback used for getting the current screen brightness. The param is in the |
33 // range [0.0, 100.0]. | 33 // range [0.0, 100.0]. |
34 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; | 34 typedef base::Callback<void(double)> GetScreenBrightnessPercentCallback; |
35 | 35 |
36 // PowerManagerClient is used to communicate with the power manager. | 36 // PowerManagerClient is used to communicate with the power manager. |
37 class CHROMEOS_EXPORT PowerManagerClient { | 37 class CHROMEOS_EXPORT PowerManagerClient { |
38 public: | 38 public: |
39 // Interface for observing changes from the power manager. | 39 // Interface for observing changes from the power manager. |
40 class Observer { | 40 class Observer { |
41 public: | 41 public: |
| 42 enum ScreenDimmingState { |
| 43 SCREEN_DIMMING_NONE = 0, |
| 44 SCREEN_DIMMING_IDLE, |
| 45 }; |
| 46 |
42 virtual ~Observer() {} | 47 virtual ~Observer() {} |
43 | 48 |
44 // Called when the brightness is changed. | 49 // Called when the brightness is changed. |
45 // |level| is of the range [0, 100]. | 50 // |level| is of the range [0, 100]. |
46 // |user_initiated| is true if the action is initiated by the user. | 51 // |user_initiated| is true if the action is initiated by the user. |
47 virtual void BrightnessChanged(int level, bool user_initiated) {} | 52 virtual void BrightnessChanged(int level, bool user_initiated) {} |
48 | 53 |
49 // Called when power supply polling takes place. |status| is a data | 54 // Called when power supply polling takes place. |status| is a data |
50 // structure that contains the current state of the power supply. | 55 // structure that contains the current state of the power supply. |
51 virtual void PowerChanged(const PowerSupplyStatus& status) {} | 56 virtual void PowerChanged(const PowerSupplyStatus& status) {} |
(...skipping 16 matching lines...) Expand all Loading... |
68 virtual void UnlockScreen() {} | 73 virtual void UnlockScreen() {} |
69 | 74 |
70 // Called when the screen fails to unlock. | 75 // Called when the screen fails to unlock. |
71 virtual void UnlockScreenFailed() {} | 76 virtual void UnlockScreenFailed() {} |
72 | 77 |
73 // Called when we go idle for threshold time. | 78 // Called when we go idle for threshold time. |
74 virtual void IdleNotify(int64 threshold_secs) {} | 79 virtual void IdleNotify(int64 threshold_secs) {} |
75 | 80 |
76 // Called when we go from idle to active. | 81 // Called when we go from idle to active. |
77 virtual void ActiveNotify() {} | 82 virtual void ActiveNotify() {} |
| 83 |
| 84 // Called when a request is received to dim or undim the screen in software |
| 85 // (as opposed to the more-common method of adjusting the backlight). |
| 86 virtual void ScreenDimmingRequested(ScreenDimmingState state) {} |
78 }; | 87 }; |
79 | 88 |
80 enum UpdateRequestType { | 89 enum UpdateRequestType { |
81 UPDATE_INITIAL, // Initial update request. | 90 UPDATE_INITIAL, // Initial update request. |
82 UPDATE_USER, // User initialted update request. | 91 UPDATE_USER, // User initialted update request. |
83 UPDATE_POLL // Update requested by poll signal. | 92 UPDATE_POLL // Update requested by poll signal. |
84 }; | 93 }; |
85 | 94 |
86 enum PowerStateOverrideType { | 95 enum PowerStateOverrideType { |
87 DISABLE_IDLE_DIM = 1, // Disable screen dimming on idle. | 96 DISABLE_IDLE_DIM = 1, // Disable screen dimming on idle. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Create() should be used instead. | 183 // Create() should be used instead. |
175 PowerManagerClient(); | 184 PowerManagerClient(); |
176 | 185 |
177 private: | 186 private: |
178 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 187 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
179 }; | 188 }; |
180 | 189 |
181 } // namespace chromeos | 190 } // namespace chromeos |
182 | 191 |
183 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 192 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
OLD | NEW |