Index: base/system_monitor/system_monitor.h |
=================================================================== |
--- base/system_monitor/system_monitor.h (revision 146883) |
+++ base/system_monitor/system_monitor.h (working copy) |
@@ -5,11 +5,13 @@ |
#ifndef BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ |
#define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ |
+#include <map> |
#include <string> |
#include <vector> |
#include "base/base_export.h" |
#include "base/basictypes.h" |
+#include "base/string16.h" |
#include "base/tuple.h" |
#include "build/build_config.h" |
@@ -35,8 +37,6 @@ |
#include <objc/runtime.h> |
#endif // OS_IOS |
-class FilePath; |
- |
namespace base { |
// Class for monitoring various system-related subsystems |
@@ -51,9 +51,15 @@ |
RESUME_EVENT // The system is being resumed. |
}; |
+ enum MediaDeviceType { |
+ TYPE_PATH, |
+ TYPE_MTP, |
+ }; |
+ |
typedef unsigned int DeviceIdType; |
vandebo (ex-Chrome)
2012/07/19 19:05:20
With unique_id being a string, I think you can get
Lei Zhang
2012/07/19 23:07:25
Done.
|
- // (Media device id, Media device name, Media device path) |
- typedef Tuple3<DeviceIdType, std::string, FilePath> MediaDeviceInfo; |
+ // (Media device id, Media device name, Media device type, Media device data) |
+ typedef Tuple4<DeviceIdType, std::string, MediaDeviceType, string16> |
vandebo (ex-Chrome)
2012/07/19 19:05:20
Why a Tuple4 and not just a struct?
Lei Zhang
2012/07/19 21:17:10
Because you were ok with a Tuple3 in the previous
|
+ MediaDeviceInfo; |
// Create SystemMonitor. Only one SystemMonitor instance per application |
// is allowed. |
@@ -115,11 +121,10 @@ |
// When a media device is attached or detached, one of these two events |
// is triggered. |
- // 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) {} |
+ MediaDeviceType type, |
+ const string16& data) {} |
virtual void OnMediaDeviceDetached(const DeviceIdType& id) {} |
@@ -153,7 +158,15 @@ |
void ProcessDevicesChanged(); |
void ProcessMediaDeviceAttached(const DeviceIdType& id, |
const std::string& name, |
- const FilePath& path); |
+ MediaDeviceType type, |
+ const string16& data); |
+#if defined(OS_POSIX) |
+ // Provided for convenience. |
+ void ProcessMediaDeviceAttached(const DeviceIdType& id, |
+ const std::string& name, |
+ MediaDeviceType type, |
+ const std::string& data); |
+#endif |
void ProcessMediaDeviceDetached(const DeviceIdType& id); |
// Returns information for attached media devices. |
@@ -180,7 +193,8 @@ |
void NotifyDevicesChanged(); |
void NotifyMediaDeviceAttached(const DeviceIdType& id, |
const std::string& name, |
- const FilePath& path); |
+ MediaDeviceType type, |
+ const string16& data); |
void NotifyMediaDeviceDetached(const DeviceIdType& id); |
void NotifyPowerStateChange(); |
void NotifySuspend(); |