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..b083452d5ed48cb4ee065c673186d7c3e34ecd5b 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,32 @@ class FakePowerManagerClient : public PowerManagerClient { |
// Notifies observers that the power button has been pressed or released. |
void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); |
+ // Updates the PowerSupplyProperties and NotifyObservers of its changes. |
+ void UpdatePowerProperties( |
+ int battery_percent, |
+ bool is_calculating_battery_time, |
+ power_manager::PowerSupplyProperties::BatteryState battery_state, |
+ power_manager::PowerSupplyProperties::ExternalPower external_power); |
+ |
+ const power_manager::PowerSupplyProperties& props() { return props_; } |
+ |
private: |
// Callback that will be run by asynchronous suspend delays to report |
// readiness. |
void HandleSuspendReadiness(); |
+ // Tells TrayPower to update its contents to the Updated |
+ // PowerSupplyProperties. |
+ 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_; |