mac: Let IPhotoDataProvider::GetAlbumNames() return albums in a deterministic order.
[chromium-blink-merge.git] / base / power_monitor / power_monitor_device_source_chromeos.cc
blobc3466ee15a1ebc3bd6eff823a1384e3dc9f8a9df
1 // Copyright 2014 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.
5 #include "base/power_monitor/power_monitor.h"
6 #include "base/power_monitor/power_monitor_device_source.h"
7 #include "base/power_monitor/power_monitor_source.h"
9 namespace base {
11 namespace {
13 // The most-recently-seen power source.
14 bool g_on_battery = false;
16 } // namespace
18 // static
19 void PowerMonitorDeviceSource::SetPowerSource(bool on_battery) {
20 if (on_battery != g_on_battery) {
21 g_on_battery = on_battery;
22 ProcessPowerEvent(POWER_STATE_EVENT);
26 // static
27 void PowerMonitorDeviceSource::HandleSystemSuspending() {
28 ProcessPowerEvent(SUSPEND_EVENT);
31 // static
32 void PowerMonitorDeviceSource::HandleSystemResumed() {
33 ProcessPowerEvent(RESUME_EVENT);
36 bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() {
37 return g_on_battery;
40 } // namespace base