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

Side by Side Diff: base/power_monitor/power_monitor_device_source_win.cc

Issue 281223002: Removed LOG_GETLASTERROR and LOG_ERRNO macros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wed 05/14/2014 11:20:03.21 Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/mac/os_crash_dumps.cc ('k') | base/process/kill_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/power_monitor/power_monitor.h" 5 #include "base/power_monitor/power_monitor.h"
6 #include "base/power_monitor/power_monitor_device_source.h" 6 #include "base/power_monitor/power_monitor_device_source.h"
7 #include "base/power_monitor/power_monitor_source.h" 7 #include "base/power_monitor/power_monitor_source.h"
8 #include "base/win/wrapped_window_proc.h" 8 #include "base/win/wrapped_window_proc.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ProcessPowerEventHelper(power_event); 48 ProcessPowerEventHelper(power_event);
49 } 49 }
50 50
51 } // namespace 51 } // namespace
52 52
53 // Function to query the system to see if it is currently running on 53 // Function to query the system to see if it is currently running on
54 // battery power. Returns true if running on battery. 54 // battery power. Returns true if running on battery.
55 bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() { 55 bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() {
56 SYSTEM_POWER_STATUS status; 56 SYSTEM_POWER_STATUS status;
57 if (!GetSystemPowerStatus(&status)) { 57 if (!GetSystemPowerStatus(&status)) {
58 DLOG_GETLASTERROR(ERROR) << "GetSystemPowerStatus failed"; 58 DPLOG(ERROR) << "GetSystemPowerStatus failed";
59 return false; 59 return false;
60 } 60 }
61 return (status.ACLineStatus == 0); 61 return (status.ACLineStatus == 0);
62 } 62 }
63 63
64 PowerMonitorDeviceSource::PowerMessageWindow::PowerMessageWindow() 64 PowerMonitorDeviceSource::PowerMessageWindow::PowerMessageWindow()
65 : instance_(NULL), message_hwnd_(NULL) { 65 : instance_(NULL), message_hwnd_(NULL) {
66 if (!MessageLoopForUI::IsCurrent()) { 66 if (!MessageLoopForUI::IsCurrent()) {
67 // Creating this window in (e.g.) a renderer inhibits shutdown on Windows. 67 // Creating this window in (e.g.) a renderer inhibits shutdown on Windows.
68 // See http://crbug.com/230122. TODO(vandebo): http://crbug.com/236031 68 // See http://crbug.com/230122. TODO(vandebo): http://crbug.com/236031
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 switch (message) { 101 switch (message) {
102 case WM_POWERBROADCAST: 102 case WM_POWERBROADCAST:
103 ProcessWmPowerBroadcastMessage(wparam); 103 ProcessWmPowerBroadcastMessage(wparam);
104 return TRUE; 104 return TRUE;
105 default: 105 default:
106 return ::DefWindowProc(hwnd, message, wparam, lparam); 106 return ::DefWindowProc(hwnd, message, wparam, lparam);
107 } 107 }
108 } 108 }
109 109
110 } // namespace base 110 } // namespace base
OLDNEW
« no previous file with comments | « base/mac/os_crash_dumps.cc ('k') | base/process/kill_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698