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

Unified Diff: chrome/browser/storage_monitor/image_capture_device_manager.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/image_capture_device_manager.mm
diff --git a/chrome/browser/storage_monitor/image_capture_device_manager.mm b/chrome/browser/storage_monitor/image_capture_device_manager.mm
index b51d32c38a3d09924ee18a69addbf880338e1d11..28e251884884b642d5020ced8f4a89f7c10af187 100644
--- a/chrome/browser/storage_monitor/image_capture_device_manager.mm
+++ b/chrome/browser/storage_monitor/image_capture_device_manager.mm
@@ -146,6 +146,16 @@ void ImageCaptureDeviceManager::SetNotifications(
[device_browser_ setNotifications:notifications];
}
+void ImageCaptureDeviceManager::EjectDevice(
+ const std::string& uuid,
+ base::Callback<void(StorageMonitor::EjectStatus)> callback) {
+ base::scoped_nsobject<ImageCaptureDevice> camera_device(
sail 2013/09/09 21:26:13 Is there a reason you need to keep a strong refere
Greg Billock 2013/09/12 17:43:59 No, not really. This is how we did it elsewhere, s
+ [[device_browser_ deviceForUUID:uuid] retain]);
+ [camera_device eject];
+ [camera_device close];
+ callback.Run(StorageMonitor::EJECT_OK);
+}
+
// static
ImageCaptureDevice* ImageCaptureDeviceManager::deviceForUUID(
const std::string& uuid) {

Powered by Google App Engine
This is Rietveld 408576698