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

Unified Diff: chrome/browser/media_gallery/media_file_system_registry.cc

Issue 10780023: Change base::SystemMonitor's media device functions to take a type and string16 instead of a FilePa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix win Created 8 years, 5 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: 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;

Powered by Google App Engine
This is Rietveld 408576698