Index: chrome/browser/media_gallery/media_file_system_registry.cc |
=================================================================== |
--- chrome/browser/media_gallery/media_file_system_registry.cc (revision 146883) |
+++ chrome/browser/media_gallery/media_file_system_registry.cc (working copy) |
@@ -9,6 +9,7 @@ |
#include <set> |
#include "base/path_service.h" |
+#include "base/utf_string_conversions.h" |
#include "chrome/common/chrome_paths.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_source.h" |
@@ -60,11 +61,19 @@ |
const std::vector<SystemMonitor::MediaDeviceInfo> media_devices = |
monitor->GetAttachedMediaDevices(); |
for (size_t i = 0; i < media_devices.size(); ++i) { |
- const SystemMonitor::DeviceIdType& id = media_devices[i].a; |
- const FilePath& path = media_devices[i].c; |
- device_id_map_.insert(std::make_pair(id, path)); |
- std::string fsid = RegisterPathAsFileSystem(path); |
- child_it->second.insert(std::make_pair(path, fsid)); |
+ if (media_devices[i].c == SystemMonitor::TYPE_PATH) { |
+ const SystemMonitor::DeviceIdType& id = media_devices[i].a; |
+ const FilePath path( |
+#if defined(OS_WIN) |
vandebo (ex-Chrome)
2012/07/19 19:05:20
ugg... Anyway to kill the ifdef here?
Lei Zhang
2012/07/19 21:17:10
If we make location FilePath::StringType instead o
|
+ media_devices[i].d |
+#else |
+ UTF16ToUTF8(media_devices[i].d) |
+#endif |
+ ); |
+ device_id_map_.insert(std::make_pair(id, path)); |
+ std::string fsid = RegisterPathAsFileSystem(path); |
+ child_it->second.insert(std::make_pair(path, fsid)); |
+ } |
} |
MediaPathToFSIDMap& child_map = child_it->second; |