Chromium Code Reviews| 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 e7f39cdc5bd66f4605835222ed0ac442caed5a2d..54535aa607229406f0e3aac42c1ba14d2fadf745 100644 |
| --- a/chrome/browser/system_monitor/media_storage_util.cc |
| +++ b/chrome/browser/system_monitor/media_storage_util.cc |
| @@ -254,22 +254,30 @@ bool MediaStorageUtil::GetDeviceInfoFromPath(const FilePath& path, |
| #endif |
| if (found_device && IsRemovableDevice(device_info.device_id)) { |
| - if (device_id) |
| - *device_id = device_info.device_id; |
| - if (device_name) |
| - *device_name = device_info.name; |
| - if (relative_path) { |
| - *relative_path = FilePath(); |
| - FilePath mount_point(device_info.location); |
| - bool success = mount_point.AppendRelativePath(path, relative_path); |
| -#if defined(OS_POSIX) |
| - if (!relative_path->value().empty() && device_name) { |
| + FilePath sub_folder_path; |
| + if (device_name || relative_path) { |
| + bool success = FilePath(device_info.location) |
| + .AppendRelativePath(path, &sub_folder_path); |
| + DCHECK(success); |
| + } |
| + |
| +#if defined(OS_CHROMEOS) |
|
Lei Zhang
2012/11/09 01:12:18
So after this CL, Linux no longer gets folder name
kmadhusu
2012/11/09 21:59:40
Yes. Linux changes are ready for review (https://c
|
| + if (device_name) { |
|
Lei Zhang
2012/11/09 01:12:18
Can we do all the |device_name| appends in one blo
kmadhusu
2012/11/09 21:59:40
sure.
|
| + *device_name = notifier->GetStorageSizeInfo(device_info.location) + |
| + ASCIIToUTF16(" "); |
| + if (!sub_folder_path.value().empty()) { |
| *device_name += ASCIIToUTF16(" (") + |
| - relative_path->BaseName().LossyDisplayName() + ASCIIToUTF16(")"); |
| + sub_folder_path.BaseName().LossyDisplayName() + ASCIIToUTF16(") "); |
| } |
| -#endif |
| - DCHECK(success); |
| } |
| +#endif |
| + |
| + if (device_id) |
| + *device_id = device_info.device_id; |
| + if (device_name) |
| + *device_name += device_info.name; |
| + if (relative_path) |
| + *relative_path = sub_folder_path; |
| return true; |
| } |