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_CROS_POWER_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 }; | 31 }; |
32 | 32 |
33 virtual ~PowerLibrary() {} | 33 virtual ~PowerLibrary() {} |
34 | 34 |
35 virtual void Init() = 0; | 35 virtual void Init() = 0; |
36 | 36 |
37 virtual void AddObserver(Observer* observer) = 0; | 37 virtual void AddObserver(Observer* observer) = 0; |
38 virtual void RemoveObserver(Observer* observer) = 0; | 38 virtual void RemoveObserver(Observer* observer) = 0; |
39 | 39 |
40 // Whether or not the line power is connected. | 40 // Whether or not the line power is connected. |
41 virtual bool line_power_on() const = 0; | 41 virtual bool IsLinePowerOn() const = 0; |
42 | 42 |
43 // Whether or not the battery is fully charged. | 43 // Whether or not the battery is fully charged. |
44 virtual bool battery_fully_charged() const = 0; | 44 virtual bool IsBatteryFullyCharged() const = 0; |
45 | 45 |
46 // The percentage [0-100] of remaining battery. | 46 // The percentage [0-100] of remaining battery. |
47 virtual double battery_percentage() const = 0; | 47 virtual double GetBatteryPercentage() const = 0; |
48 | 48 |
49 // Whether there is a battery present. | 49 // Whether there is a battery present. |
50 virtual bool battery_is_present() const = 0; | 50 virtual bool IsBatteryPresent() const = 0; |
51 | 51 |
52 // The amount of time until battery is empty. | 52 // The amount of time until battery is empty. |
53 virtual base::TimeDelta battery_time_to_empty() const = 0; | 53 virtual base::TimeDelta GetBatteryTimeToEmpty() const = 0; |
54 | 54 |
55 // The amount of time until battery is full. | 55 // The amount of time until battery is full. |
56 virtual base::TimeDelta battery_time_to_full() const = 0; | 56 virtual base::TimeDelta GetBatteryTimeToFull() const = 0; |
57 | 57 |
58 // Calculates idle time asynchronously. If it encounters some error, | 58 // Calculates idle time asynchronously. If it encounters some error, |
59 // it returns -1. | 59 // it returns -1. |
60 virtual void CalculateIdleTime(CalculateIdleTimeCallback* callback) = 0; | 60 virtual void CalculateIdleTime(CalculateIdleTimeCallback* callback) = 0; |
61 | 61 |
62 // Enable/disable screen lock for current session. | 62 // Enable/disable screen lock for current session. |
63 virtual void EnableScreenLock(bool enable) = 0; | 63 virtual void EnableScreenLock(bool enable) = 0; |
64 | 64 |
65 // Requests restart of the system. | 65 // Requests restart of the system. |
66 virtual void RequestRestart() = 0; | 66 virtual void RequestRestart() = 0; |
67 | 67 |
68 // Requests shutdown of the system. | 68 // Requests shutdown of the system. |
69 virtual void RequestShutdown() = 0; | 69 virtual void RequestShutdown() = 0; |
70 | 70 |
71 // UI initiated request for status update. | 71 // UI initiated request for status update. |
72 virtual void RequestStatusUpdate() = 0; | 72 virtual void RequestStatusUpdate() = 0; |
73 | 73 |
74 // Factory function, creates a new instance and returns ownership. | 74 // Factory function, creates a new instance and returns ownership. |
75 // For normal usage, access the singleton via CrosLibrary::Get(). | 75 // For normal usage, access the singleton via CrosLibrary::Get(). |
76 static PowerLibrary* GetImpl(bool stub); | 76 static PowerLibrary* GetImpl(bool stub); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace chromeos | 79 } // namespace chromeos |
80 | 80 |
81 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ | 81 #endif // CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_ |
OLD | NEW |