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

Unified Diff: chrome/browser/media_gallery/media_storage_util.cc

Issue 10882039: Make the Linux System Monitor implementation track all devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 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/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
« no previous file with comments | « chrome/browser/media_gallery/media_storage_util.h ('k') | chrome/browser/media_gallery/removable_device_notifications_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698