This source file includes following definitions.
- BatteryCheck
#include "base/power_monitor/power_monitor_device_source.h"
#include "base/time/time.h"
namespace base {
#if defined(ENABLE_BATTERY_MONITORING)
static int kDelayedBatteryCheckMs = 10 * 1000;
#endif
PowerMonitorDeviceSource::PowerMonitorDeviceSource() {
DCHECK(MessageLoop::current());
#if defined(ENABLE_BATTERY_MONITORING)
delayed_battery_check_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kDelayedBatteryCheckMs), this,
&PowerMonitorDeviceSource::BatteryCheck);
#endif
#if defined(OS_MACOSX)
PlatformInit();
#endif
}
PowerMonitorDeviceSource::~PowerMonitorDeviceSource() {
#if defined(OS_MACOSX)
PlatformDestroy();
#endif
}
void PowerMonitorDeviceSource::BatteryCheck() {
ProcessPowerEvent(PowerMonitorSource::POWER_STATE_EVENT);
}
}