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

Side by Side Diff: base/power_monitor/power_monitor_device_source.h

Issue 668783004: Standardize usage of virtual/override/final in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted Created 6 years, 2 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
« no previous file with comments | « base/posix/file_descriptor_shuffle_unittest.cc ('k') | base/prefs/default_pref_store.h » ('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 #ifndef BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_ 5 #ifndef BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_
6 #define BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_ 6 #define BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 19 matching lines...) Expand all
30 #include <objc/runtime.h> 30 #include <objc/runtime.h>
31 #endif // OS_IOS 31 #endif // OS_IOS
32 32
33 namespace base { 33 namespace base {
34 34
35 // A class used to monitor the power state change and notify the observers about 35 // A class used to monitor the power state change and notify the observers about
36 // the change event. 36 // the change event.
37 class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource { 37 class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource {
38 public: 38 public:
39 PowerMonitorDeviceSource(); 39 PowerMonitorDeviceSource();
40 virtual ~PowerMonitorDeviceSource(); 40 ~PowerMonitorDeviceSource() override;
41 41
42 #if defined(OS_MACOSX) 42 #if defined(OS_MACOSX)
43 // Allocate system resources needed by the PowerMonitor class. 43 // Allocate system resources needed by the PowerMonitor class.
44 // 44 //
45 // This function must be called before instantiating an instance of the class 45 // This function must be called before instantiating an instance of the class
46 // and before the Sandbox is initialized. 46 // and before the Sandbox is initialized.
47 #if !defined(OS_IOS) 47 #if !defined(OS_IOS)
48 static void AllocateSystemIOPorts(); 48 static void AllocateSystemIOPorts();
49 #else 49 #else
50 static void AllocateSystemIOPorts() {} 50 static void AllocateSystemIOPorts() {}
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #endif // OS_WIN 83 #endif // OS_WIN
84 84
85 #if defined(OS_MACOSX) 85 #if defined(OS_MACOSX)
86 void PlatformInit(); 86 void PlatformInit();
87 void PlatformDestroy(); 87 void PlatformDestroy();
88 #endif 88 #endif
89 89
90 // Platform-specific method to check whether the system is currently 90 // Platform-specific method to check whether the system is currently
91 // running on battery power. Returns true if running on batteries, 91 // running on battery power. Returns true if running on batteries,
92 // false otherwise. 92 // false otherwise.
93 virtual bool IsOnBatteryPowerImpl() override; 93 bool IsOnBatteryPowerImpl() override;
94 94
95 // Checks the battery status and notifies observers if the battery 95 // Checks the battery status and notifies observers if the battery
96 // status has changed. 96 // status has changed.
97 void BatteryCheck(); 97 void BatteryCheck();
98 98
99 #if defined(OS_IOS) 99 #if defined(OS_IOS)
100 // Holds pointers to system event notification observers. 100 // Holds pointers to system event notification observers.
101 std::vector<id> notification_observers_; 101 std::vector<id> notification_observers_;
102 #endif 102 #endif
103 103
104 #if defined(ENABLE_BATTERY_MONITORING) 104 #if defined(ENABLE_BATTERY_MONITORING)
105 base::OneShotTimer<PowerMonitorDeviceSource> delayed_battery_check_; 105 base::OneShotTimer<PowerMonitorDeviceSource> delayed_battery_check_;
106 #endif 106 #endif
107 107
108 #if defined(OS_WIN) 108 #if defined(OS_WIN)
109 PowerMessageWindow power_message_window_; 109 PowerMessageWindow power_message_window_;
110 #endif 110 #endif
111 111
112 DISALLOW_COPY_AND_ASSIGN(PowerMonitorDeviceSource); 112 DISALLOW_COPY_AND_ASSIGN(PowerMonitorDeviceSource);
113 }; 113 };
114 114
115 } // namespace base 115 } // namespace base
116 116
117 #endif // BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_ 117 #endif // BASE_POWER_MONITOR_POWER_MONITOR_DEVICE_SOURCE_H_
OLDNEW
« no previous file with comments | « base/posix/file_descriptor_shuffle_unittest.cc ('k') | base/prefs/default_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698