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

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

Issue 19489006: Media Galleries: Move gallery name generation back to StorageMonitor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 7 years, 4 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
===================================================================
--- chrome/browser/extensions/api/system_storage/storage_info_provider.cc (revision 218837)
+++ chrome/browser/extensions/api/system_storage/storage_info_provider.cc (working copy)
@@ -25,11 +25,16 @@
StorageUnitInfo* unit) {
unit->id = StorageMonitor::GetInstance()->GetTransientIdForDeviceId(
info.device_id());
- unit->name = UTF16ToUTF8(info.name());
- // TODO(hmin): Might need to take MTP device into consideration.
- unit->type = chrome::StorageInfo::IsRemovableDevice(info.device_id()) ?
- STORAGE_UNIT_TYPE_REMOVABLE : STORAGE_UNIT_TYPE_FIXED;
unit->capacity = static_cast<double>(info.total_size_in_bytes());
+
+ if (chrome::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());
+ unit->type = STORAGE_UNIT_TYPE_FIXED;
+ }
}
} // namespace systeminfo

Powered by Google App Engine
This is Rietveld 408576698