| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/storage_monitor/image_capture_device_manager.h" | 5 #include "chrome/browser/storage_monitor/image_capture_device_manager.h" |
| 6 | 6 |
| 7 #import <ImageCaptureCore/ImageCaptureCore.h> | 7 #import <ImageCaptureCore/ImageCaptureCore.h> |
| 8 | 8 |
| 9 #import "chrome/browser/storage_monitor/image_capture_device.h" | 9 #import "chrome/browser/storage_monitor/image_capture_device.h" |
| 10 #include "chrome/browser/storage_monitor/storage_info.h" | 10 #include "chrome/browser/storage_monitor/storage_info.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ImageCaptureDeviceManager::~ImageCaptureDeviceManager() { | 139 ImageCaptureDeviceManager::~ImageCaptureDeviceManager() { |
| 140 g_image_capture_device_manager = NULL; | 140 g_image_capture_device_manager = NULL; |
| 141 [device_browser_ close]; | 141 [device_browser_ close]; |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ImageCaptureDeviceManager::SetNotifications( | 144 void ImageCaptureDeviceManager::SetNotifications( |
| 145 StorageMonitor::Receiver* notifications) { | 145 StorageMonitor::Receiver* notifications) { |
| 146 [device_browser_ setNotifications:notifications]; | 146 [device_browser_ setNotifications:notifications]; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ImageCaptureDeviceManager::EjectDevice( |
| 150 const std::string& uuid, |
| 151 base::Callback<void(StorageMonitor::EjectStatus)> callback) { |
| 152 base::scoped_nsobject<ImageCaptureDevice> camera_device( |
| 153 [[device_browser_ deviceForUUID:uuid] retain]); |
| 154 [camera_device eject]; |
| 155 callback.Run(StorageMonitor::EJECT_OK); |
| 156 } |
| 157 |
| 149 // static | 158 // static |
| 150 ImageCaptureDevice* ImageCaptureDeviceManager::deviceForUUID( | 159 ImageCaptureDevice* ImageCaptureDeviceManager::deviceForUUID( |
| 151 const std::string& uuid) { | 160 const std::string& uuid) { |
| 152 ImageCaptureDeviceManagerImpl* manager = | 161 ImageCaptureDeviceManagerImpl* manager = |
| 153 g_image_capture_device_manager->device_browser_; | 162 g_image_capture_device_manager->device_browser_; |
| 154 return [manager deviceForUUID:uuid]; | 163 return [manager deviceForUUID:uuid]; |
| 155 } | 164 } |
| 156 | 165 |
| 157 id<ICDeviceBrowserDelegate> ImageCaptureDeviceManager::device_browser() { | 166 id<ICDeviceBrowserDelegate> ImageCaptureDeviceManager::device_browser() { |
| 158 return device_browser_.get(); | 167 return device_browser_.get(); |
| 159 } | 168 } |
| 160 | 169 |
| 161 } // namespace chrome | 170 } // namespace chrome |
| OLD | NEW |