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

Unified Diff: base/system_monitor/system_monitor.h

Issue 8523021: Send WM_DEVICECHANGE message through SystemMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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: 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_;
« no previous file with comments | « no previous file | base/system_monitor/system_monitor.cc » ('j') | base/system_monitor/system_monitor_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698