From 5dd4a2c8d4c8cb889069388fcf0105962b99c50d Mon Sep 17 00:00:00 2001 From: "kmadhusu@chromium.org" Date: Mon, 14 Nov 2011 23:49:03 +0000 Subject: Revert 109960 - Send WM_DEVICECHANGE message through SystemMonitor WM_DEVICECHANGE is sent when there's been a change to devices or the computer; specifically when a USB device is connected or disconnected. This is intended for use in support of Gamepads for more performant polling and connect/disconnect testing. Currently only on Windows, though seems reasonable to add for other platforms in the future. BUG=79050 Review URL: http://codereview.chromium.org/8523021 TBR=scottmg@chromium.org Review URL: http://codereview.chromium.org/8528044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109979 0039d316-1c4b-4281-b951-d872f2087c98 --- base/system_monitor/system_monitor.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'base/system_monitor/system_monitor.h') diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h index 7684523..c779994 100644 --- a/base/system_monitor/system_monitor.h +++ b/base/system_monitor/system_monitor.h @@ -90,26 +90,15 @@ class BASE_EXPORT SystemMonitor { virtual ~PowerObserver() {} }; - class BASE_EXPORT DevicesChangedObserver { - public: - // Notification that the devices connected to the system have changed. - virtual void OnDevicesChanged() {} - - protected: - virtual ~DevicesChangedObserver() {} - }; - // Add a new observer. // Can be called from any thread. // Must not be called from within a notification callback. - void AddPowerObserver(PowerObserver* obs); - void AddDevicesChangedObserver(DevicesChangedObserver* obs); + void AddObserver(PowerObserver* obs); // Remove an existing observer. // Can be called from any thread. // Must not be called from within a notification callback. - void RemovePowerObserver(PowerObserver* obs); - void RemoveDevicesChangedObserver(DevicesChangedObserver* obs); + void RemoveObserver(PowerObserver* obs); #if defined(OS_WIN) // Windows-specific handling of a WM_POWERBROADCAST message. @@ -121,9 +110,6 @@ 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 ProcessDevicesChanged(); - private: #if defined(OS_MACOSX) void PlatformInit(); @@ -140,14 +126,11 @@ class BASE_EXPORT SystemMonitor { void BatteryCheck(); // Functions to trigger notifications. - void NotifyDevicesChanged(); void NotifyPowerStateChange(); void NotifySuspend(); void NotifyResume(); - scoped_refptr > power_observer_list_; - scoped_refptr > - devices_changed_observer_list_; + scoped_refptr > observer_list_; bool battery_in_use_; bool suspended_; -- cgit v1.1