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

Unified Diff: chrome/browser/extensions/api/system_storage/storage_info_provider.cc

Issue 120303003: [StorageMonitor] Move gallery name generation to StorageInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 years, 10 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/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());
}

Powered by Google App Engine
This is Rietveld 408576698