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

Unified Diff: chrome/browser/chromeos/file_manager/volume_manager.cc

Issue 305053004: Use .volume_label property for notifying MTP volume labels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/volume_manager.cc
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc
index 829e1972283e30bf8a884b25c07d34ddb24747c5..cb1f8ed789925eec8c6217517ac51ed8ebae6c66 100644
--- a/chrome/browser/chromeos/file_manager/volume_manager.cc
+++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -729,9 +729,9 @@ void VolumeManager::OnRemovableStorageAttached(
const std::string base_name = base::UTF16ToUTF8(info.model_name());
// Assign a fresh volume ID based on the volume name.
- std::string id = kMtpVolumeIdPrefix + base_name;
- for (int i = 2; mounted_volumes_.count(id); ++i)
- id = kMtpVolumeIdPrefix + base_name + base::StringPrintf(" (%d)", i);
+ std::string label = base_name;
+ for (int i = 2; mounted_volumes_.count(kMtpVolumeIdPrefix + label); ++i)
+ label = base_name + base::StringPrintf(" (%d)", i);
bool result =
fileapi::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
@@ -750,7 +750,8 @@ void VolumeManager::OnRemovableStorageAttached(
volume_info.mount_condition = chromeos::disks::MOUNT_CONDITION_NONE;
volume_info.is_parent = true;
volume_info.is_read_only = true;
- volume_info.volume_id = id;
+ volume_info.volume_id = kMtpVolumeIdPrefix + label;
+ volume_info.volume_label = label;
volume_info.source_path = path;
volume_info.device_type = chromeos::DEVICE_TYPE_MOBILE;
DoMountEvent(chromeos::MOUNT_ERROR_NONE, volume_info, false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698