Index: chrome/browser/intents/device_attached_intent_source.cc |
=================================================================== |
--- chrome/browser/intents/device_attached_intent_source.cc (revision 146883) |
+++ chrome/browser/intents/device_attached_intent_source.cc (working copy) |
@@ -33,14 +33,25 @@ |
void DeviceAttachedIntentSource::OnMediaDeviceAttached( |
const base::SystemMonitor::DeviceIdType& id, |
const std::string& name, |
- const FilePath& device_path) { |
+ base::SystemMonitor::MediaDeviceType type, |
+ const string16& data) { |
if (!browser_->window()->IsActive()) |
return; |
+ // Only handle FilePaths for now. |
+ if (type != SystemMonitor::TYPE_PATH) |
+ return; |
+ |
+ const FilePath device_path = |
+#if defined(OS_POSIX) |
+ FilePath(UTF16ToUTF8(data)); |
+#else |
+ FilePath(data); |
+#endif |
+ |
// Sanity checks for |device_path|. |
- if (!device_path.IsAbsolute() || device_path.ReferencesParent()) { |
+ if (!device_path.IsAbsolute() || device_path.ReferencesParent()) |
return; |
- } |
std::string device_name; |