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

Unified Diff: chrome/browser/system_monitor/media_storage_util.cc

Issue 10911350: Update Windows System Monitor Removable Device Impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 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/system_monitor/media_storage_util.cc
diff --git a/chrome/browser/system_monitor/media_storage_util.cc b/chrome/browser/system_monitor/media_storage_util.cc
index 94969b65b4987671808e55104da8223754699537..40dc3b885b84519bbfd00f6268be2e6089069e9d 100644
--- a/chrome/browser/system_monitor/media_storage_util.cc
+++ b/chrome/browser/system_monitor/media_storage_util.cc
@@ -235,7 +235,7 @@ bool MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path,
bool found_device = false;
base::SystemMonitor::RemovableStorageInfo device_info;
-#if (defined(OS_LINUX) || defined(OS_MACOSX))
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
RemovableDeviceNotifications* notifier =
RemovableDeviceNotifications::GetInstance();
found_device = notifier->GetDeviceInfoForPath(path, &device_info);
@@ -262,6 +262,12 @@ bool MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path,
return true;
}
+ // On Posix systems, there's one root so any absolute path could be valid.
+#if !defined(OS_POSIX)
+ if (!found_device)
+ return false;
+#endif
+
if (device_id)
*device_id = MakeDeviceId(FIXED_MASS_STORAGE, path.AsUTF8Unsafe());
if (device_name)
« no previous file with comments | « chrome/browser/chrome_browser_main_win.cc ('k') | chrome/browser/system_monitor/removable_device_notifications_window_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698