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

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

Issue 10911234: Update Windows System Monitor Removable Device Impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Win compile 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 b01ea0d5f3b356800e5cee8b3b81740f5cf8ff4e..aee0023c650f9988120eef9112fd85dc9ec1d933 100644
--- a/chrome/browser/system_monitor/media_storage_util.cc
+++ b/chrome/browser/system_monitor/media_storage_util.cc
@@ -29,7 +29,7 @@ const char kRemovableMassStorageNoDCIMPrefix[] = "nodcim:";
const char kFixedMassStoragePrefix[] = "path:";
const char kMtpPtpPrefix[] = "mtp:";
-static void (*g_test_get_device_info_from_path_function)(
+static bool (*g_test_get_device_info_from_path_function)(
const FilePath& path, std::string* device_id, string16* device_name,
FilePath* relative_path) = NULL;
@@ -146,15 +146,17 @@ void MediaStorageUtil::IsDeviceAttached(const std::string& device_id,
}
// static
-void MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path,
+bool MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path,
std::string* device_id,
string16* device_name,
FilePath* relative_path) {
if (g_test_get_device_info_from_path_function) {
- g_test_get_device_info_from_path_function(path, device_id, device_name,
- relative_path);
+ return g_test_get_device_info_from_path_function(path, device_id,
+ device_name,
+ relative_path);
} else {
- GetDeviceInfoFromPathImpl(path, device_id, device_name, relative_path);
+ return GetDeviceInfoFromPathImpl(path, device_id, device_name,
+ relative_path);
}
}
@@ -184,9 +186,9 @@ void MediaStorageUtil::SetGetDeviceInfoFromPathFunctionForTesting(
MediaStorageUtil::MediaStorageUtil() {}
-#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if !defined(OS_WIN) || !defined(OS_LINUX) || defined(OS_CHROMEOS)
// static
-void MediaStorageUtil::GetDeviceInfoFromPathImpl(const FilePath& path,
+bool MediaStorageUtil::GetDeviceInfoFromPathImpl(const FilePath& path,
std::string* device_id,
string16* device_name,
FilePath* relative_path) {
@@ -202,6 +204,7 @@ void MediaStorageUtil::GetDeviceInfoFromPathImpl(const FilePath& path,
*device_name = path.BaseName().LossyDisplayName();
if (relative_path)
*relative_path = FilePath();
+ return true;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698