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

Unified Diff: base/power_monitor/power_monitor_win.cc

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add PlatformInit/Destory for all platforms Created 8 years, 1 month 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
Index: base/power_monitor/power_monitor_win.cc
diff --git a/base/system_monitor/system_monitor_win.cc b/base/power_monitor/power_monitor_win.cc
similarity index 85%
rename from base/system_monitor/system_monitor_win.cc
rename to base/power_monitor/power_monitor_win.cc
index a8cd54a6db1b8e27716e9b489650c30e8ce849ec..112692c38829eb8e9bbb87f40b2b2f17dd6e74ff 100644
--- a/base/system_monitor/system_monitor_win.cc
+++ b/base/power_monitor/power_monitor_win.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/system_monitor/system_monitor.h"
+#include "base/power_monitor/power_monitor.h"
namespace base {
-void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) {
+void PowerMonitor::ProcessWmPowerBroadcastMessage(int event_id) {
PowerEvent power_event;
switch (event_id) {
case PBT_APMPOWERSTATUSCHANGE: // The power status changed.
@@ -33,12 +33,18 @@ void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) {
// PBT_APMRESUMECRITICAL - removed in Vista.
// PBT_POWERSETTINGCHANGE - user changed the power settings.
}
- ProcessPowerMessage(power_event);
+ ProcessPowerEvent(power_event);
+}
+
+void PowerMonitor::PlatformInit() {
+}
+
+void PowerMonitor::PlatformDestroy() {
}
// Function to query the system to see if it is currently running on
// battery power. Returns true if running on battery.
-bool SystemMonitor::IsBatteryPower() {
+bool PowerMonitor::IsBatteryPower() {
SYSTEM_POWER_STATUS status;
if (!GetSystemPowerStatus(&status)) {
DLOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError();

Powered by Google App Engine
This is Rietveld 408576698