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

Unified Diff: services/device/battery/battery_status_manager_win.cc

Issue 2818673003: [DeviceService] Expose battery monitoring solely via the Device Service (Closed)
Patch Set: Java file format change Created 3 years, 8 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
Index: services/device/battery/battery_status_manager_win.cc
diff --git a/device/battery/battery_status_manager_win.cc b/services/device/battery/battery_status_manager_win.cc
similarity index 93%
rename from device/battery/battery_status_manager_win.cc
rename to services/device/battery/battery_status_manager_win.cc
index 9bc8ad5c6e21249c797389e0ddae949ad02d9df6..252001f4cce8c4f2df56cbcaba23bd0f0d2067f8 100644
--- a/device/battery/battery_status_manager_win.cc
+++ b/services/device/battery/battery_status_manager_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "device/battery/battery_status_manager_win.h"
+#include "services/device/battery/battery_status_manager_win.h"
#include <memory>
@@ -12,7 +12,7 @@
#include "base/strings/string16.h"
#include "base/win/message_window.h"
#include "base/win/windows_version.h"
-#include "device/battery/battery_status_manager.h"
+#include "services/device/battery/battery_status_manager.h"
namespace device {
@@ -32,8 +32,7 @@ enum NumberBatteriesType {
};
void UpdateNumberBatteriesHistogram(NumberBatteriesType count) {
- UMA_HISTOGRAM_ENUMERATION("BatteryStatus.NumberBatteriesWin",
- count,
+ UMA_HISTOGRAM_ENUMERATION("BatteryStatus.NumberBatteriesWin", count,
BATTERY_TYPES_COUNT);
}
@@ -58,8 +57,7 @@ class BatteryStatusObserver {
explicit BatteryStatusObserver(const BatteryCallback& callback)
: power_handle_(NULL),
battery_change_handle_(NULL),
- callback_(callback) {
- }
+ callback_(callback) {}
~BatteryStatusObserver() { DCHECK(!window_); }
@@ -71,8 +69,7 @@ class BatteryStatusObserver {
// e.g. when a power source is connected.
// TODO(timvolodine) : consider polling for battery changes on windows
// versions prior to Vista, see crbug.com/402466.
- power_handle_ =
- RegisterNotification(&GUID_ACDC_POWER_SOURCE);
+ power_handle_ = RegisterNotification(&GUID_ACDC_POWER_SOURCE);
battery_change_handle_ =
RegisterNotification(&GUID_BATTERY_PERCENTAGE_REMAINING);
} else {
@@ -109,7 +106,7 @@ class BatteryStatusObserver {
WPARAM wparam,
LPARAM lparam,
LRESULT* result) {
- switch(message) {
+ switch (message) {
case WM_POWERBROADCAST:
if (wparam == PBT_APMPOWERSTATUSCHANGE ||
wparam == PBT_POWERSETTINGCHANGE) {
@@ -127,7 +124,7 @@ class BatteryStatusObserver {
return NULL;
return RegisterPowerSettingNotification(window_->hwnd(), power_setting,
- DEVICE_NOTIFY_WINDOW_HANDLE);
+ DEVICE_NOTIFY_WINDOW_HANDLE);
}
BOOL UnregisterNotification(HPOWERNOTIFY handle) {
« no previous file with comments | « services/device/battery/battery_status_manager_win.h ('k') | services/device/battery/battery_status_manager_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698