| 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
|
|
|
|
|