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

Unified Diff: chromeos/dbus/fake_power_manager_client.h

Issue 1206733002: ChromeOs Power Emulation Impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created unittest for FakePowerManagerClient Created 5 years, 6 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: chromeos/dbus/fake_power_manager_client.h
diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h
index d6cd0429f975b899ec2a64fc8f8158dce391a83d..6b14024205d34e479b37ebabb00c5660073ec53d 100644
--- a/chromeos/dbus/fake_power_manager_client.h
+++ b/chromeos/dbus/fake_power_manager_client.h
@@ -7,10 +7,9 @@
#include <string>
-#include "base/basictypes.h"
-#include "base/macros.h"
#include "base/observer_list.h"
#include "chromeos/dbus/power_manager/policy.pb.h"
+#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
#include "chromeos/dbus/power_manager/suspend.pb.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -67,16 +66,33 @@ class FakePowerManagerClient : public PowerManagerClient {
// Notifies observers that the power button has been pressed or released.
void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp);
+ void UpdatePowerProperties(
+ int battery_percent,
+ bool is_calculating_battery_time,
+ power_manager::PowerSupplyProperties::BatteryState battery_state,
+ power_manager::PowerSupplyProperties::ExternalPower external_power);
+
+ power_manager::PowerSupplyProperties GetPowerSupplyProperties() {
Daniel Erat 2015/06/30 22:13:31 this is inlined, so you should just name it props(
mozartalouis 2015/07/01 00:43:28 Done.
+ return props_;
+ }
+
private:
// Callback that will be run by asynchronous suspend delays to report
// readiness.
void HandleSuspendReadiness();
+ // Called once any power states are changed to notify the observer of the
+ // change.
+ void NotifyObservers();
+
base::ObserverList<Observer> observers_;
// Last policy passed to SetPolicy().
power_manager::PowerManagementPolicy policy_;
+ // The power properties set for for the UI.
+ power_manager::PowerSupplyProperties props_;
+
// Number of times that various methods have been called.
int num_request_restart_calls_;
int num_request_shutdown_calls_;

Powered by Google App Engine
This is Rietveld 408576698