diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 15:01:12 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 15:01:12 +0000 |
commit | 52a261f59b20e89f8c5936bce642362f8e367b57 (patch) | |
tree | fcc7b3c100caaf43848cd9a241beafc883f93b7d /base/system_monitor_win.cc | |
parent | 7d926f9072ac496db6df715cc6a6bd5d3f9bd011 (diff) | |
download | chromium_src-52a261f59b20e89f8c5936bce642362f8e367b57.zip chromium_src-52a261f59b20e89f8c5936bce642362f8e367b57.tar.gz chromium_src-52a261f59b20e89f8c5936bce642362f8e367b57.tar.bz2 |
NO CODE CHANGE (except one global std::wstring changed to const wchar_t* const per style compliance).
Preliminary work to enforce new PRESUBMIT.py rules:
- <=80 cols
- no trailing whitespaces
- svn:eol-style=LF
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor_win.cc')
-rw-r--r-- | base/system_monitor_win.cc | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/base/system_monitor_win.cc b/base/system_monitor_win.cc index 7e07d7e..8bd604c 100644 --- a/base/system_monitor_win.cc +++ b/base/system_monitor_win.cc @@ -1,49 +1,49 @@ -// Copyright (c) 2008 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/system_monitor.h"
-
-namespace base {
-
-void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) {
- PowerEvent power_event;
- switch (event_id) {
- case PBT_APMPOWERSTATUSCHANGE: // The power status changed.
- power_event = POWER_STATE_EVENT;
- break;
- case PBT_APMRESUMEAUTOMATIC: // Non-user initiated resume from suspend.
- case PBT_APMRESUMESUSPEND: // User initiated resume from suspend.
- power_event = RESUME_EVENT;
- break;
- case PBT_APMSUSPEND: // System has been suspended.
- power_event = SUSPEND_EVENT;
- break;
- default:
- return;
-
- // Other Power Events:
- // PBT_APMBATTERYLOW - removed in Vista.
- // PBT_APMOEMEVENT - removed in Vista.
- // PBT_APMQUERYSUSPEND - removed in Vista.
- // PBT_APMQUERYSUSPENDFAILED - removed in Vista.
- // PBT_APMRESUMECRITICAL - removed in Vista.
- // PBT_POWERSETTINGCHANGE - user changed the power settings.
- }
- ProcessPowerMessage(power_event);
-}
-
-// Function to query the system to see if it is currently running on
-// battery power. Returns true if running on battery.
-bool SystemMonitor::IsBatteryPower() {
- SYSTEM_POWER_STATUS status;
- if (!GetSystemPowerStatus(&status)) {
- LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();
- return false;
- }
- return (status.ACLineStatus == 0);
-}
-
-
-
-} // namespace base
+// Copyright (c) 2008 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/system_monitor.h" + +namespace base { + +void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { + PowerEvent power_event; + switch (event_id) { + case PBT_APMPOWERSTATUSCHANGE: // The power status changed. + power_event = POWER_STATE_EVENT; + break; + case PBT_APMRESUMEAUTOMATIC: // Non-user initiated resume from suspend. + case PBT_APMRESUMESUSPEND: // User initiated resume from suspend. + power_event = RESUME_EVENT; + break; + case PBT_APMSUSPEND: // System has been suspended. + power_event = SUSPEND_EVENT; + break; + default: + return; + + // Other Power Events: + // PBT_APMBATTERYLOW - removed in Vista. + // PBT_APMOEMEVENT - removed in Vista. + // PBT_APMQUERYSUSPEND - removed in Vista. + // PBT_APMQUERYSUSPENDFAILED - removed in Vista. + // PBT_APMRESUMECRITICAL - removed in Vista. + // PBT_POWERSETTINGCHANGE - user changed the power settings. + } + ProcessPowerMessage(power_event); +} + +// Function to query the system to see if it is currently running on +// battery power. Returns true if running on battery. +bool SystemMonitor::IsBatteryPower() { + SYSTEM_POWER_STATUS status; + if (!GetSystemPowerStatus(&status)) { + LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); + return false; + } + return (status.ACLineStatus == 0); +} + + + +} // namespace base |