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

Unified Diff: chrome/browser/storage_monitor/storage_monitor_linux.cc

Issue 23383009: [StorageMonitor] Handle EjectDevice call for MTP devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/storage_monitor/storage_monitor_linux.cc
diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.cc b/chrome/browser/storage_monitor/storage_monitor_linux.cc
index 3be93b981eb174dc6f3eeb7b65c87627d72ed416..a8096f6c747f15c2a4ec58a1d1a535062a59a5d7 100644
--- a/chrome/browser/storage_monitor/storage_monitor_linux.cc
+++ b/chrome/browser/storage_monitor/storage_monitor_linux.cc
@@ -334,6 +334,17 @@ void StorageMonitorLinux::SetMediaTransferProtocolManagerForTest(
void StorageMonitorLinux::EjectDevice(
const std::string& device_id,
base::Callback<void(EjectStatus)> callback) {
+ StorageInfo::Type type;
+ if (!StorageInfo::CrackDeviceId(device_id, &type, NULL)) {
+ callback.Run(EJECT_FAILURE);
+ return;
+ }
+
+ if (type == StorageInfo::MTP_OR_PTP) {
+ media_transfer_protocol_device_observer_->EjectDevice(device_id, callback);
+ return;
+ }
+
// Find the mount point for the given device ID.
base::FilePath path;
base::FilePath device;

Powered by Google App Engine
This is Rietveld 408576698