| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ | 5 #ifndef BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ |
| 6 #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ | 6 #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Must not be called from within a notification callback. | 152 // Must not be called from within a notification callback. |
| 153 void AddPowerObserver(PowerObserver* obs); | 153 void AddPowerObserver(PowerObserver* obs); |
| 154 void AddDevicesChangedObserver(DevicesChangedObserver* obs); | 154 void AddDevicesChangedObserver(DevicesChangedObserver* obs); |
| 155 | 155 |
| 156 // Remove an existing observer. | 156 // Remove an existing observer. |
| 157 // Can be called from any thread. | 157 // Can be called from any thread. |
| 158 // Must not be called from within a notification callback. | 158 // Must not be called from within a notification callback. |
| 159 void RemovePowerObserver(PowerObserver* obs); | 159 void RemovePowerObserver(PowerObserver* obs); |
| 160 void RemoveDevicesChangedObserver(DevicesChangedObserver* obs); | 160 void RemoveDevicesChangedObserver(DevicesChangedObserver* obs); |
| 161 | 161 |
| 162 // The ProcessFoo() style methods are a broken pattern and should not |
| 163 // be copied. Any significant addition to this class is blocked on |
| 164 // refactoring to improve the state of affairs. See http://crbug.com/149059 |
| 165 |
| 162 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 163 // Windows-specific handling of a WM_POWERBROADCAST message. | 167 // Windows-specific handling of a WM_POWERBROADCAST message. |
| 164 // Embedders of this API should hook their top-level window | 168 // Embedders of this API should hook their top-level window |
| 165 // message loop and forward WM_POWERBROADCAST through this call. | 169 // message loop and forward WM_POWERBROADCAST through this call. |
| 166 void ProcessWmPowerBroadcastMessage(int event_id); | 170 void ProcessWmPowerBroadcastMessage(int event_id); |
| 167 #endif | 171 #endif |
| 168 | 172 |
| 169 // Cross-platform handling of a power event. | 173 // Cross-platform handling of a power event. |
| 170 void ProcessPowerMessage(PowerEvent event_id); | 174 void ProcessPowerMessage(PowerEvent event_id); |
| 171 | 175 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 225 |
| 222 // Map of all the attached removable storage devices. | 226 // Map of all the attached removable storage devices. |
| 223 RemovableStorageMap removable_storage_map_; | 227 RemovableStorageMap removable_storage_map_; |
| 224 | 228 |
| 225 DISALLOW_COPY_AND_ASSIGN(SystemMonitor); | 229 DISALLOW_COPY_AND_ASSIGN(SystemMonitor); |
| 226 }; | 230 }; |
| 227 | 231 |
| 228 } // namespace base | 232 } // namespace base |
| 229 | 233 |
| 230 #endif // BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ | 234 #endif // BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ |
| OLD | NEW |