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

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

Issue 23383009: [StorageMonitor] Handle EjectDevice call for MTP devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Close camera after request eject (mac) Created 7 years, 3 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_chromeos.cc
diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
index 8b7f8de1422966b7f288834f5d1f877654e705aa..f8a99fcc33ca60f87053e328249d6cce33d0cb5f 100644
--- a/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
+++ b/chrome/browser/storage_monitor/storage_monitor_chromeos.cc
@@ -247,6 +247,17 @@ void NotifyUnmountResult(
void StorageMonitorCros::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;
+ }
+
std::string mount_path;
for (MountMap::const_iterator info_it = mount_map_.begin();
info_it != mount_map_.end(); ++info_it) {

Powered by Google App Engine
This is Rietveld 408576698