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_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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // |level| is of the range [0, 100]. | 47 // |level| is of the range [0, 100]. |
48 // |user_initiated| is true if the action is initiated by the user. | 48 // |user_initiated| is true if the action is initiated by the user. |
49 virtual void BrightnessChanged(int level, bool user_initiated) {} | 49 virtual void BrightnessChanged(int level, bool user_initiated) {} |
50 | 50 |
51 // Called when power supply polling takes place. |status| is a data | 51 // Called when power supply polling takes place. |status| is a data |
52 // structure that contains the current state of the power supply. | 52 // structure that contains the current state of the power supply. |
53 virtual void PowerChanged(const PowerSupplyStatus& status) {} | 53 virtual void PowerChanged(const PowerSupplyStatus& status) {} |
54 | 54 |
55 // Called when the system resumes from suspend. | 55 // Called when the system resumes from suspend. |
56 virtual void SystemResumed() {} | 56 virtual void SystemResumed() {} |
57 | |
58 // Called when the screen is locked. | |
59 virtual void LockScreen() {} | |
60 | |
61 // Called when the screen is unlocked. | |
62 virtual void UnlockScreen() {} | |
63 | |
64 // Called when the screen fails to unlock. | |
65 virtual void UnlockScreenFailed() {} | |
66 }; | 57 }; |
67 | 58 |
68 // Adds and removes the observer. | 59 // Adds and removes the observer. |
69 virtual void AddObserver(Observer* observer) = 0; | 60 virtual void AddObserver(Observer* observer) = 0; |
70 virtual void RemoveObserver(Observer* observer) = 0; | 61 virtual void RemoveObserver(Observer* observer) = 0; |
71 | 62 |
72 // Decreases the screen brightness. |allow_off| controls whether or not | 63 // Decreases the screen brightness. |allow_off| controls whether or not |
73 // it's allowed to turn off the back light. | 64 // it's allowed to turn off the back light. |
74 virtual void DecreaseScreenBrightness(bool allow_off) = 0; | 65 virtual void DecreaseScreenBrightness(bool allow_off) = 0; |
75 | 66 |
76 // Increases the screen brightness. | 67 // Increases the screen brightness. |
77 virtual void IncreaseScreenBrightness() = 0; | 68 virtual void IncreaseScreenBrightness() = 0; |
78 | 69 |
79 // UI initiated request for power supply status update. | 70 // UI initiated request for power supply status update. |
80 virtual void RequestStatusUpdate() = 0; | 71 virtual void RequestStatusUpdate() = 0; |
81 | 72 |
82 // Requests restart of the system. | 73 // Requests restart of the system. |
83 virtual void RequestRestart() = 0; | 74 virtual void RequestRestart() = 0; |
84 | 75 |
85 // Requests shutdown of the system. | 76 // Requests shutdown of the system. |
86 virtual void RequestShutdown() = 0; | 77 virtual void RequestShutdown() = 0; |
87 | 78 |
88 // Calculates idle time asynchronously, after the idle time request has | 79 // Calculates idle time asynchronously, after the idle time request has |
89 // replied. It passes the idle time in seconds to |callback|. If it | 80 // replied. It passes the idle time in seconds to |callback|. If it |
90 // encounters some error, it passes -1 to |callback|. | 81 // encounters some error, it passes -1 to |callback|. |
91 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0; | 82 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0; |
92 | 83 |
93 // Notifies PowerManager that a user requested to lock the screen. | |
94 virtual void NotifyScreenLockRequested() = 0; | |
95 | |
96 // Notifies PowerManager that screen lock has been completed. | |
97 virtual void NotifyScreenLockCompleted() = 0; | |
98 | |
99 // Notifies PowerManager that a user unlocked the screen. | |
100 virtual void NotifyScreenUnlockRequested() = 0; | |
101 | |
102 // Notifies PowerManager that screen is unlocked. | |
103 virtual void NotifyScreenUnlockCompleted() = 0; | |
104 | |
105 // Creates the instance. | 84 // Creates the instance. |
106 static PowerManagerClient* Create(dbus::Bus* bus); | 85 static PowerManagerClient* Create(dbus::Bus* bus); |
107 | 86 |
108 virtual ~PowerManagerClient(); | 87 virtual ~PowerManagerClient(); |
109 | 88 |
110 protected: | 89 protected: |
111 // Create() should be used instead. | 90 // Create() should be used instead. |
112 PowerManagerClient(); | 91 PowerManagerClient(); |
113 | 92 |
114 private: | 93 private: |
115 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 94 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
116 }; | 95 }; |
117 | 96 |
118 } // namespace chromeos | 97 } // namespace chromeos |
119 | 98 |
120 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
OLD | NEW |