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

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

Issue 8271024: chromeos: Add power supply info reading capability (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 10f99f5b43bc1e2377fd1b7bf10cbbd405215cb7..3b152de49242e5ada6789c15fdcb898d184364e3 100644
--- a/chrome/browser/chromeos/cros/power_library.h
+++ b/chrome/browser/chromeos/cros/power_library.h
@@ -6,7 +6,10 @@
#define CHROME_BROWSER_CHROMEOS_CROS_POWER_LIBRARY_H_
#pragma once
+// TODO(sque): Move to chrome/browser/chromeos/system, crosbug.com/16558
+
#include "base/callback.h"
+#include "chrome/browser/chromeos/dbus/power_manager_client.h"
namespace base {
class TimeDelta;
@@ -15,11 +18,12 @@ 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
// library class like this: chromeos::CrosLibrary::Get()->GetPowerLibrary()
-class PowerLibrary {
+class PowerLibrary : public PowerManagerClient::Observer {
public:
class Observer {
public:
@@ -71,6 +75,10 @@ class PowerLibrary {
// UI initiated request for status update.
virtual void RequestStatusUpdate() = 0;
+ // Requests power supply info.
+ virtual void UpdatePowerStatus(const chromeos::PowerStatus& status) = 0;
+
+
// Factory function, creates a new instance and returns ownership.
// For normal usage, access the singleton via CrosLibrary::Get().
static PowerLibrary* GetImpl(bool stub);

Powered by Google App Engine
This is Rietveld 408576698