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

Unified Diff: base/system_monitor/system_monitor.h

Issue 9363008: Add Media device notification to SystemMonitor and Mac impl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 10 months 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 7684523616e0bd787e3a30f5ded9c40e1f7b5371..36b5cbad2214db5b58cd801ed30834eec0475696 100644
--- a/base/system_monitor/system_monitor.h
+++ b/base/system_monitor/system_monitor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,6 +28,8 @@
#include <IOKit/IOMessage.h>
#endif // OS_MACOSX
+class FilePath;
+
namespace base {
// Class for monitoring various system-related subsystems
@@ -42,6 +44,8 @@ class BASE_EXPORT SystemMonitor {
RESUME_EVENT // The system is being resumed.
};
+ typedef unsigned long DeviceIdType;
+
// Create SystemMonitor. Only one SystemMonitor instance per application
// is allowed.
SystemMonitor();
@@ -93,8 +97,19 @@ class BASE_EXPORT SystemMonitor {
class BASE_EXPORT DevicesChangedObserver {
public:
// Notification that the devices connected to the system have changed.
+ // This is only implemented on Windows currently.
virtual void OnDevicesChanged() {}
+ // When a media device is attached or detached, one of these two events
+ // if triggered.
tpayne 2012/02/28 19:31:42 typo (is)
vandebo (ex-Chrome) 2012/02/28 20:36:10 Done.
+ // TODO(vandebo) Pass an appropriate device identifier or way to interact
+ // with the devices instead of FilePath.
+ virtual void OnMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ const FilePath& path) {}
+
+ virtual void OnMediaDeviceDetached(const DeviceIdType& id) {}
+
protected:
virtual ~DevicesChangedObserver() {}
};
@@ -123,6 +138,10 @@ class BASE_EXPORT SystemMonitor {
// Cross-platform handling of a device change event.
void ProcessDevicesChanged();
+ void ProcessMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ const FilePath& path);
+ void ProcessMediaDeviceDetached(const DeviceIdType& id);
private:
#if defined(OS_MACOSX)
@@ -141,6 +160,10 @@ class BASE_EXPORT SystemMonitor {
// Functions to trigger notifications.
void NotifyDevicesChanged();
+ void NotifyMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ const FilePath& path);
+ void NotifyMediaDeviceDetached(const DeviceIdType& id);
void NotifyPowerStateChange();
void NotifySuspend();
void NotifyResume();

Powered by Google App Engine
This is Rietveld 408576698