Chromium Code Reviews| Index: chrome/browser/extensions/api/system_storage/storage_info_provider.cc |
| diff --git a/chrome/browser/extensions/api/system_storage/storage_info_provider.cc b/chrome/browser/extensions/api/system_storage/storage_info_provider.cc |
| index 9057c50a383e71390b6c36c23841ac66dc088032..57728290f86061c079194900df136f7ffb07898b 100644 |
| --- a/chrome/browser/extensions/api/system_storage/storage_info_provider.cc |
| +++ b/chrome/browser/extensions/api/system_storage/storage_info_provider.cc |
| @@ -28,10 +28,14 @@ void BuildStorageUnitInfo(const StorageInfo& info, |
| StorageUnitInfo* unit) { |
| unit->id = StorageMonitor::GetInstance()->GetTransientIdForDeviceId( |
| info.device_id()); |
| - unit->name = base::UTF16ToUTF8(info.name()); |
| - // TODO(hmin): Might need to take MTP device into consideration. |
| - unit->type = StorageInfo::IsRemovableDevice(info.device_id()) ? |
| - STORAGE_UNIT_TYPE_REMOVABLE : STORAGE_UNIT_TYPE_FIXED; |
| + if (StorageInfo::IsRemovableDevice(info.device_id())) { |
| + // TODO(hmin): Might need to take MTP device into consideration. |
| + unit->name = base::UTF16ToUTF8(info.GetDisplayName(false)); |
| + unit->type = STORAGE_UNIT_TYPE_REMOVABLE; |
| + } else { |
| + unit->name = base::UTF16ToUTF8(info.storage_label()); |
|
vandebo (ex-Chrome)
2014/03/03 19:58:31
This should probably get handled at the lower leve
Haojian Wu
2014/03/04 05:00:12
you mean move this out of the BuildStorageUnitInfo
vandebo (ex-Chrome)
2014/03/04 19:24:47
Now that GetDisplayName works for removable device
Haojian Wu
2014/03/05 07:28:09
I see. Done.
|
| + unit->type = STORAGE_UNIT_TYPE_FIXED; |
| + } |
| unit->capacity = static_cast<double>(info.total_size_in_bytes()); |
| } |