| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual ~Observer() {} | 45 virtual ~Observer() {} |
| 46 | 46 |
| 47 // Called if the power manager process restarts. | 47 // Called if the power manager process restarts. |
| 48 virtual void PowerManagerRestarted() {} | 48 virtual void PowerManagerRestarted() {} |
| 49 | 49 |
| 50 // Called when the brightness is changed. | 50 // Called when the brightness is changed. |
| 51 // |level| is of the range [0, 100]. | 51 // |level| is of the range [0, 100]. |
| 52 // |user_initiated| is true if the action is initiated by the user. | 52 // |user_initiated| is true if the action is initiated by the user. |
| 53 virtual void BrightnessChanged(int level, bool user_initiated) {} | 53 virtual void BrightnessChanged(int level, bool user_initiated) {} |
| 54 | 54 |
| 55 // Called when a screen is turned on or off to request that Chrome enable or | |
| 56 // disable the corresponding CRTC for the output. | |
| 57 // |power_on| The new state of the power setting. | |
| 58 // |all_displays| True if this applies to all displays or false if it is | |
| 59 // the internal display only. | |
| 60 // TODO(derat): Remove this. | |
| 61 virtual void ScreenPowerSet(bool power_on, bool all_displays) {} | |
| 62 | |
| 63 // Called when power supply polling takes place. |status| is a data | 55 // Called when power supply polling takes place. |status| is a data |
| 64 // structure that contains the current state of the power supply. | 56 // structure that contains the current state of the power supply. |
| 65 virtual void PowerChanged(const PowerSupplyStatus& status) {} | 57 virtual void PowerChanged(const PowerSupplyStatus& status) {} |
| 66 | 58 |
| 67 // Called when we go idle for threshold time. | 59 // Called when we go idle for threshold time. |
| 68 virtual void IdleNotify(int64 threshold_secs) {} | 60 virtual void IdleNotify(int64 threshold_secs) {} |
| 69 | 61 |
| 70 // Called when a request is received to dim or undim the screen in software | 62 // Called when a request is received to dim or undim the screen in software |
| 71 // (as opposed to the more-common method of adjusting the backlight). | 63 // (as opposed to the more-common method of adjusting the backlight). |
| 72 virtual void ScreenDimmingRequested(ScreenDimmingState state) {} | 64 virtual void ScreenDimmingRequested(ScreenDimmingState state) {} |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 137 |
| 146 // Requests notification for Idle at a certain threshold. | 138 // Requests notification for Idle at a certain threshold. |
| 147 // NOTE: This notification is one shot, once the machine has been idle for | 139 // NOTE: This notification is one shot, once the machine has been idle for |
| 148 // threshold time, a notification will be sent and then that request will be | 140 // threshold time, a notification will be sent and then that request will be |
| 149 // removed from the notification queue. If you wish notifications the next | 141 // removed from the notification queue. If you wish notifications the next |
| 150 // time the machine goes idle for that much time, request again. | 142 // time the machine goes idle for that much time, request again. |
| 151 virtual void RequestIdleNotification(int64 threshold_secs) = 0; | 143 virtual void RequestIdleNotification(int64 threshold_secs) = 0; |
| 152 | 144 |
| 153 // Notifies the power manager that the user is active (i.e. generating input | 145 // Notifies the power manager that the user is active (i.e. generating input |
| 154 // events). | 146 // events). |
| 155 virtual void NotifyUserActivity( | 147 virtual void NotifyUserActivity() = 0; |
| 156 const base::TimeTicks& last_activity_time) = 0; | |
| 157 | 148 |
| 158 // Notifies the power manager that a video is currently playing. It also | 149 // Notifies the power manager that a video is currently playing. It also |
| 159 // includes whether or not the containing window for the video is fullscreen. | 150 // includes whether or not the containing window for the video is fullscreen. |
| 160 virtual void NotifyVideoActivity( | 151 virtual void NotifyVideoActivity( |
| 161 const base::TimeTicks& last_activity_time, | 152 const base::TimeTicks& last_activity_time, |
| 162 bool is_fullscreen) = 0; | 153 bool is_fullscreen) = 0; |
| 163 | 154 |
| 164 // Tells the power manager to begin using |policy|. | 155 // Tells the power manager to begin using |policy|. |
| 165 virtual void SetPolicy( | 156 virtual void SetPolicy( |
| 166 const power_manager::PowerManagementPolicy& policy) = 0; | 157 const power_manager::PowerManagementPolicy& policy) = 0; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 184 // Create() should be used instead. | 175 // Create() should be used instead. |
| 185 PowerManagerClient(); | 176 PowerManagerClient(); |
| 186 | 177 |
| 187 private: | 178 private: |
| 188 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 179 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 189 }; | 180 }; |
| 190 | 181 |
| 191 } // namespace chromeos | 182 } // namespace chromeos |
| 192 | 183 |
| 193 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 184 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |