| Index: base/power_monitor/power_monitor_source.cc
|
| diff --git a/base/power_monitor/power_monitor_source.cc b/base/power_monitor/power_monitor_source.cc
|
| index 6868cb19e338e17b7d5c960b606b8f22845893da..5d27a0e5a07b0513f412df7a0a098003e73192c8 100644
|
| --- a/base/power_monitor/power_monitor_source.cc
|
| +++ b/base/power_monitor/power_monitor_source.cc
|
| @@ -5,16 +5,12 @@
|
| #include "base/power_monitor/power_monitor_source.h"
|
|
|
| #include "base/power_monitor/power_monitor.h"
|
| +#include "build/build_config.h"
|
|
|
| namespace base {
|
|
|
| -PowerMonitorSource::PowerMonitorSource()
|
| - : on_battery_power_(false),
|
| - suspended_(false) {
|
| -}
|
| -
|
| -PowerMonitorSource::~PowerMonitorSource() {
|
| -}
|
| +PowerMonitorSource::PowerMonitorSource() {}
|
| +PowerMonitorSource::~PowerMonitorSource() {}
|
|
|
| bool PowerMonitorSource::IsOnBatteryPower() {
|
| AutoLock auto_lock(battery_lock_);
|
| @@ -63,4 +59,11 @@ void PowerMonitorSource::ProcessPowerEvent(PowerEvent event_id) {
|
| }
|
| }
|
|
|
| +void PowerMonitorSource::SetInitialOnBatteryPowerState(bool on_battery_power) {
|
| + // Must only be called before a monitor exists, otherwise the caller should
|
| + // have just used a normal ProcessPowerEvent(POWER_STATE_EVENT) call.
|
| + DCHECK(!PowerMonitor::Get());
|
| + on_battery_power_ = on_battery_power;
|
| +}
|
| +
|
| } // namespace base
|
|
|