Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1699)

Unified Diff: app/system_monitor_win.cc

Issue 6361002: Move SystemMonitor to src/chrome/common.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/system_monitor_unittest.cc ('k') | chrome/browser/browser_main.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/system_monitor_win.cc
===================================================================
--- app/system_monitor_win.cc (revision 71446)
+++ app/system_monitor_win.cc (working copy)
@@ -1,46 +0,0 @@
-// Copyright (c) 2009 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 "app/system_monitor.h"
-
-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: // Resume from suspend.
- //case PBT_APMRESUMESUSPEND: // User-initiated resume from suspend.
- // We don't notify for this latter event
- // because if it occurs it is always sent as a
- // second event after PBT_APMRESUMEAUTOMATIC.
- 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);
-}
« no previous file with comments | « app/system_monitor_unittest.cc ('k') | chrome/browser/browser_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698