Chromium Code Reviews| Index: base/system_monitor/system_monitor.h |
| diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h |
| index c7799945fa53be685f26a999061f5847647cf4f0..224620a14e8f81c5c2295a5743eb0401abe52736 100644 |
| --- a/base/system_monitor/system_monitor.h |
| +++ b/base/system_monitor/system_monitor.h |
| @@ -90,15 +90,25 @@ class BASE_EXPORT SystemMonitor { |
| virtual ~PowerObserver() {} |
| }; |
| + class BASE_EXPORT DeviceChangeObserver { |
| + public: |
| + // Notification that the devices connected to the system have changed. |
| + virtual void OnDeviceChange() {} |
|
sky
2011/11/11 02:32:59
OnDevicesChanged?
scottmg
2011/11/11 05:06:09
Done.
|
| + protected: |
|
sky
2011/11/11 02:32:59
newline between 96 and 97
scottmg
2011/11/11 05:06:09
Done.
|
| + virtual ~DeviceChangeObserver() {} |
| + }; |
| + |
| // Add a new observer. |
| // Can be called from any thread. |
| // Must not be called from within a notification callback. |
| void AddObserver(PowerObserver* obs); |
| + void AddObserver(DeviceChangeObserver* obs); |
|
sky
2011/11/11 02:32:59
style guide recommends using different names for t
scottmg
2011/11/11 05:06:09
Sorry, couldn't find something that looked relevan
|
| // Remove an existing observer. |
| // Can be called from any thread. |
| // Must not be called from within a notification callback. |
| void RemoveObserver(PowerObserver* obs); |
| + void RemoveObserver(DeviceChangeObserver* obs); |
| #if defined(OS_WIN) |
| // Windows-specific handling of a WM_POWERBROADCAST message. |
| @@ -110,6 +120,9 @@ class BASE_EXPORT SystemMonitor { |
| // Cross-platform handling of a power event. |
| void ProcessPowerMessage(PowerEvent event_id); |
| + // Cross-platform handling of a device change event. |
| + void ProcessDeviceChange(); |
|
sky
2011/11/11 02:32:59
ProcessDevicesChanged?
scottmg
2011/11/11 05:06:09
Done.
|
| + |
| private: |
| #if defined(OS_MACOSX) |
| void PlatformInit(); |
| @@ -126,11 +139,14 @@ class BASE_EXPORT SystemMonitor { |
| void BatteryCheck(); |
| // Functions to trigger notifications. |
| + void NotifyDeviceChange(); |
|
sky
2011/11/11 02:32:59
NotifyDevicesChanged
scottmg
2011/11/11 05:06:09
Done.
|
| void NotifyPowerStateChange(); |
| void NotifySuspend(); |
| void NotifyResume(); |
| - scoped_refptr<ObserverListThreadSafe<PowerObserver> > observer_list_; |
| + scoped_refptr<ObserverListThreadSafe<PowerObserver> > power_observer_list_; |
| + scoped_refptr<ObserverListThreadSafe<DeviceChangeObserver> > |
| + device_change_observer_list_; |
| bool battery_in_use_; |
| bool suspended_; |