1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/power_monitor/power_monitor_device_source.h" 6 7 namespace base { 8 PowerMonitorDeviceSource()9PowerMonitorDeviceSource::PowerMonitorDeviceSource() { 10 #if defined(OS_MACOSX) 11 PlatformInit(); 12 #endif 13 14 #if defined(OS_WIN) || defined(OS_MACOSX) 15 // Provide the correct battery status if possible. Others platforms, such as 16 // Android and ChromeOS, will update their status once their backends are 17 // actually initialized. 18 SetInitialOnBatteryPowerState(IsOnBatteryPowerImpl()); 19 #endif 20 } 21 ~PowerMonitorDeviceSource()22PowerMonitorDeviceSource::~PowerMonitorDeviceSource() { 23 #if defined(OS_MACOSX) 24 PlatformDestroy(); 25 #endif 26 } 27 28 // PowerMonitorDeviceSource does not need to take any special action to ensure 29 // that it doesn't callback into PowerMonitor after this phase of shutdown has 30 // completed. Shutdown()31void PowerMonitorDeviceSource::Shutdown() {} 32 33 } // namespace base 34