| OLD | NEW |
| 1 // Copyright (c) 2011 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 CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_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" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 | 12 |
| 13 namespace base { |
| 14 class TimeTicks; |
| 15 } |
| 13 namespace dbus { | 16 namespace dbus { |
| 14 class Bus; | 17 class Bus; |
| 15 } // namespace | 18 } |
| 16 | 19 |
| 17 namespace chromeos { | 20 namespace chromeos { |
| 18 | 21 |
| 19 // This is the local struct that is used in Chrome. | 22 // This is the local struct that is used in Chrome. |
| 20 struct PowerSupplyStatus { | 23 struct PowerSupplyStatus { |
| 21 bool line_power_on; | 24 bool line_power_on; |
| 22 | 25 |
| 23 bool battery_is_present; | 26 bool battery_is_present; |
| 24 bool battery_is_full; | 27 bool battery_is_full; |
| 25 | 28 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 50 // |user_initiated| is true if the action is initiated by the user. | 53 // |user_initiated| is true if the action is initiated by the user. |
| 51 virtual void BrightnessChanged(int level, bool user_initiated) {} | 54 virtual void BrightnessChanged(int level, bool user_initiated) {} |
| 52 | 55 |
| 53 // Called when power supply polling takes place. |status| is a data | 56 // Called when power supply polling takes place. |status| is a data |
| 54 // structure that contains the current state of the power supply. | 57 // structure that contains the current state of the power supply. |
| 55 virtual void PowerChanged(const PowerSupplyStatus& status) {} | 58 virtual void PowerChanged(const PowerSupplyStatus& status) {} |
| 56 | 59 |
| 57 // Called when the system resumes from suspend. | 60 // Called when the system resumes from suspend. |
| 58 virtual void SystemResumed() {} | 61 virtual void SystemResumed() {} |
| 59 | 62 |
| 63 // Called when the power button is pressed or released. |
| 64 virtual void PowerButtonStateChanged(bool down, |
| 65 const base::TimeTicks& timestamp) {} |
| 66 |
| 67 // Called when the lock button is pressed or released. |
| 68 virtual void LockButtonStateChanged(bool down, |
| 69 const base::TimeTicks& timestamp) {} |
| 70 |
| 60 // Called when the screen is locked. | 71 // Called when the screen is locked. |
| 61 virtual void LockScreen() {} | 72 virtual void LockScreen() {} |
| 62 | 73 |
| 63 // Called when the screen is unlocked. | 74 // Called when the screen is unlocked. |
| 64 virtual void UnlockScreen() {} | 75 virtual void UnlockScreen() {} |
| 65 | 76 |
| 66 // Called when the screen fails to unlock. | 77 // Called when the screen fails to unlock. |
| 67 virtual void UnlockScreenFailed() {} | 78 virtual void UnlockScreenFailed() {} |
| 68 }; | 79 }; |
| 69 | 80 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Create() should be used instead. | 125 // Create() should be used instead. |
| 115 PowerManagerClient(); | 126 PowerManagerClient(); |
| 116 | 127 |
| 117 private: | 128 private: |
| 118 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 129 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 119 }; | 130 }; |
| 120 | 131 |
| 121 } // namespace chromeos | 132 } // namespace chromeos |
| 122 | 133 |
| 123 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 134 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |