Index: chrome/browser/media_gallery/media_storage_util.cc |
diff --git a/chrome/browser/media_gallery/media_storage_util.cc b/chrome/browser/media_gallery/media_storage_util.cc |
index d41f13c508e3f5561c93e06c4a4c8962447cf971..e8c3e9892e7a9bfb69e89627df3397449b010747 100644 |
--- a/chrome/browser/media_gallery/media_storage_util.cc |
+++ b/chrome/browser/media_gallery/media_storage_util.cc |
@@ -102,7 +102,7 @@ std::string MediaStorageUtil::MakeDeviceId(Type type, |
bool MediaStorageUtil::CrackDeviceId(const std::string& device_id, |
Type* type, std::string* unique_id) { |
size_t prefix_length = device_id.find_first_of(':'); |
- std::string prefix = device_id.substr(0, prefix_length); |
+ std::string prefix = device_id.substr(0, prefix_length + 1); |
Lei Zhang
2012/08/27 23:17:15
You'll need to sync past r153569 and resolve this.
vandebo (ex-Chrome)
2012/08/27 23:31:11
Done.
|
Type found_type; |
if (prefix == kUsbMassStorageWithDCIMPrefix) { |
@@ -155,7 +155,7 @@ void MediaStorageUtil::IsDeviceAttached(const std::string& device_id, |
callback.Run(!FindRemovableStorageLocationById(device_id).empty()); |
break; |
case USB_MASS_STORAGE_NO_DCIM: |
- FindUSBDeviceById(unique_id, |
+ FindUSBDeviceById(device_id, |
base::Bind(&EmptyPathIsFalseCallback, callback)); |
break; |
case OTHER_MASS_STORAGE: |
@@ -201,7 +201,7 @@ void MediaStorageUtil::FindDevicePathById(const std::string& device_id, |
callback.Run(FilePath()); |
break; |
case USB_MASS_STORAGE_NO_DCIM: |
- FindUSBDeviceById(unique_id, callback); |
+ FindUSBDeviceById(device_id, callback); |
break; |
case OTHER_MASS_STORAGE: |
// For this type, the unique_id is the path. |
@@ -221,7 +221,7 @@ void MediaStorageUtil::FindDevicePathById(const std::string& device_id, |
MediaStorageUtil::MediaStorageUtil() {} |
// static |
-void MediaStorageUtil::FindUSBDeviceById(const std::string& unique_id, |
+void MediaStorageUtil::FindUSBDeviceById(const std::string& device_id, |
const FilePathCallback& callback) { |
// TODO(vandebo) This needs to be implemented per platform. |
// Type is USB_MASS_STORAGE_NO_DCIM, so it's a device possibly mounted |