diff options
author | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 01:16:35 +0000 |
---|---|---|
committer | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-31 01:16:35 +0000 |
commit | 515be83a491239753e32ddb49ee28871770964a2 (patch) | |
tree | 9040d901dfa6645769f0f9da6af6976ac5cb6f34 /base/system_monitor/system_monitor.h | |
parent | 166a8660822de18d093724318c2fde2e3c000c58 (diff) | |
download | chromium_src-515be83a491239753e32ddb49ee28871770964a2.zip chromium_src-515be83a491239753e32ddb49ee28871770964a2.tar.gz chromium_src-515be83a491239753e32ddb49ee28871770964a2.tar.bz2 |
add device type as an argument in OnDevicesChanged.
This allows DevicesChangedObserver to listen to desired events, instead of being woken up by change of uninterested devices.
BUG=137799
Review URL: https://chromiumcodereview.appspot.com/10836004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor/system_monitor.h')
-rw-r--r-- | base/system_monitor/system_monitor.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h index 359feb6..e05df74 100644 --- a/base/system_monitor/system_monitor.h +++ b/base/system_monitor/system_monitor.h @@ -51,6 +51,13 @@ class BASE_EXPORT SystemMonitor { RESUME_EVENT // The system is being resumed. }; + // Type of devices whose change need to be monitored, such as add/remove. + enum DeviceType { + DEVTYPE_AUDIO_CAPTURE, // Audio capture device, e.g., microphone. + DEVTYPE_VIDEO_CAPTURE, // Video capture device, e.g., webcam. + DEVTYPE_UNKNOWN, // Other devices. + }; + // Type of location data to identify a currently attached media device. enum MediaDeviceType { TYPE_PATH, // FilePath::StringType, e.g. a mount point. @@ -140,7 +147,7 @@ class BASE_EXPORT SystemMonitor { public: // Notification that the devices connected to the system have changed. // This is only implemented on Windows currently. - virtual void OnDevicesChanged() {} + virtual void OnDevicesChanged(DeviceType device_type) {} // When a media device is attached or detached, one of these two events // is triggered. @@ -178,7 +185,7 @@ class BASE_EXPORT SystemMonitor { void ProcessPowerMessage(PowerEvent event_id); // Cross-platform handling of a device change event. - void ProcessDevicesChanged(); + void ProcessDevicesChanged(DeviceType device_type); void ProcessMediaDeviceAttached(const std::string& id, const string16& name, MediaDeviceType type, @@ -204,7 +211,7 @@ class BASE_EXPORT SystemMonitor { void BatteryCheck(); // Functions to trigger notifications. - void NotifyDevicesChanged(); + void NotifyDevicesChanged(DeviceType device_type); void NotifyMediaDeviceAttached(const std::string& id, const string16& name, MediaDeviceType type, |