Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Unified Diff: chrome/browser/chromeos/cros/power_library.h

Issue 8347016: chromeos: Simplify power supply info in PowerLibrary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed copy error Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/cros/power_library.h
diff --git a/chrome/browser/chromeos/cros/power_library.h b/chrome/browser/chromeos/cros/power_library.h
index f29699fe104974a0ff1c51342feb3393ef2d790f..f9daec78f8254243c5d8a4c7c6e7d4854dac8bbc 100644
--- a/chrome/browser/chromeos/cros/power_library.h
+++ b/chrome/browser/chromeos/cros/power_library.h
@@ -15,6 +15,7 @@ class TimeDelta;
namespace chromeos {
typedef base::Callback<void(int64_t)> CalculateIdleTimeCallback;
+struct PowerStatus;
// This interface defines interaction with the ChromeOS power library APIs.
// Classes can add themselves as observers. Users can get an instance of this
@@ -23,7 +24,7 @@ class PowerLibrary {
public:
class Observer {
public:
- virtual void PowerChanged(PowerLibrary* obj) = 0;
+ virtual void PowerChanged(const PowerStatus& status) = 0;
virtual void SystemResumed() = 0;
protected:
@@ -37,24 +38,6 @@ class PowerLibrary {
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
- // Whether or not the line power is connected.
- virtual bool IsLinePowerOn() const = 0;
-
- // Whether or not the battery is fully charged.
- virtual bool IsBatteryFullyCharged() const = 0;
-
- // The percentage [0-100] of remaining battery.
- virtual double GetBatteryPercentage() const = 0;
-
- // Whether there is a battery present.
- virtual bool IsBatteryPresent() const = 0;
-
- // The amount of time until battery is empty.
- virtual base::TimeDelta GetBatteryTimeToEmpty() const = 0;
-
- // The amount of time until battery is full.
- virtual base::TimeDelta GetBatteryTimeToFull() const = 0;
-
// Calculates idle time asynchronously. If it encounters some error,
// it returns -1.
virtual void CalculateIdleTime(CalculateIdleTimeCallback* callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698