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

Unified Diff: chrome/browser/storage_monitor/storage_monitor_mac.mm

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_mac.mm
diff --git a/chrome/browser/storage_monitor/storage_monitor_mac.mm b/chrome/browser/storage_monitor/storage_monitor_mac.mm
index f6428645f9f0e6626e2ce53c4e367c7f327dd879..370271f903b54c0a7a3161a9060ac8f38174e35b 100644
--- a/chrome/browser/storage_monitor/storage_monitor_mac.mm
+++ b/chrome/browser/storage_monitor/storage_monitor_mac.mm
@@ -272,6 +272,19 @@ bool StorageMonitorMac::GetStorageInfoForPath(const base::FilePath& path,
void StorageMonitorMac::EjectDevice(
const std::string& device_id,
base::Callback<void(EjectStatus)> callback) {
+ StorageInfo::Type type;
+ std::string uuid;
+ if (!StorageInfo::CrackDeviceId(device_id, &type, &uuid)) {
+ callback.Run(EJECT_FAILURE);
+ return;
+ }
+
+ if (type == StorageInfo::MAC_IMAGE_CAPTURE &&
+ image_capture_device_manager_.get()) {
+ image_capture_device_manager_->EjectDevice(uuid, callback);
+ return;
+ }
+
std::string bsd_name;
for (std::map<std::string, StorageInfo>::iterator
it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) {

Powered by Google App Engine
This is Rietveld 408576698