summaryrefslogtreecommitdiff
path: root/base/power_monitor/power_monitor_device_source.cc
blob: f42065499f2488e70ca272cffe93b42a2bd77182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/power_monitor/power_monitor_device_source.h"

namespace base {

PowerMonitorDeviceSource::PowerMonitorDeviceSource() {
#if defined(OS_MACOSX)
  PlatformInit();
#endif

#if defined(OS_WIN) || defined(OS_MACOSX)
  // Provide the correct battery status if possible. Others platforms, such as
  // Android and ChromeOS, will update their status once their backends are
  // actually initialized.
  SetInitialOnBatteryPowerState(IsOnBatteryPowerImpl());
#endif
}

PowerMonitorDeviceSource::~PowerMonitorDeviceSource() {
#if defined(OS_MACOSX)
  PlatformDestroy();
#endif
}

// PowerMonitorDeviceSource does not need to take any special action to ensure
// that it doesn't callback into PowerMonitor after this phase of shutdown has
// completed.
void PowerMonitorDeviceSource::Shutdown() {}

}  // namespace base