| 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" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; | 15 chrome::ImageCaptureDeviceManager* g_image_capture_device_manager = NULL; |
| 16 | 16 |
| 17 } // namespace | 17 } // namespace |
| 18 | 18 |
| 19 // This class is the surface for the Mac ICDeviceBrowser ImageCaptureCore API. | 19 // This class is the surface for the Mac ICDeviceBrowser ImageCaptureCore API. |
| 20 // Owned by the ChromeBrowserParts and has browser process lifetime. Upon | 20 // Owned by the ChromeBrowserParts and has browser process lifetime. Upon |
| 21 // creation, it gets a list of attached media volumes (asynchronously) which | 21 // creation, it gets a list of attached media volumes (asynchronously) which |
| 22 // it will eventually forward to StorageMonitor. It will also | 22 // it will eventually forward to StorageMonitor. It will also |
| 23 // set up an ImageCaptureCore listener to be told when new devices/volumes | 23 // set up an ImageCaptureCore listener to be told when new devices/volumes |
| 24 // are discovered and existing ones are removed. | 24 // are discovered and existing ones are removed. |
| 25 @interface ImageCaptureDeviceManagerImpl | 25 @interface ImageCaptureDeviceManagerImpl |
| 26 : NSObject<ICDeviceBrowserDelegate> { | 26 : NSObject<ICDeviceBrowserDelegate> { |
| 27 @private | 27 @private |
| 28 scoped_nsobject<ICDeviceBrowser> deviceBrowser_; | 28 base::scoped_nsobject<ICDeviceBrowser> deviceBrowser_; |
| 29 scoped_nsobject<NSMutableArray> cameras_; | 29 base::scoped_nsobject<NSMutableArray> cameras_; |
| 30 | 30 |
| 31 // Guaranteed to outlive this class. | 31 // Guaranteed to outlive this class. |
| 32 // TODO(gbillock): Update when ownership chains go up through | 32 // TODO(gbillock): Update when ownership chains go up through |
| 33 // a StorageMonitor subclass. | 33 // a StorageMonitor subclass. |
| 34 chrome::StorageMonitor::Receiver* notifications_; | 34 chrome::StorageMonitor::Receiver* notifications_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 - (void)setNotifications:(chrome::StorageMonitor::Receiver*)notifications; | 37 - (void)setNotifications:(chrome::StorageMonitor::Receiver*)notifications; |
| 38 - (void)close; | 38 - (void)close; |
| 39 | 39 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 ImageCaptureDeviceManagerImpl* manager = | 153 ImageCaptureDeviceManagerImpl* manager = |
| 154 g_image_capture_device_manager->device_browser_; | 154 g_image_capture_device_manager->device_browser_; |
| 155 return [manager deviceForUUID:uuid]; | 155 return [manager deviceForUUID:uuid]; |
| 156 } | 156 } |
| 157 | 157 |
| 158 id<ICDeviceBrowserDelegate> ImageCaptureDeviceManager::device_browser() { | 158 id<ICDeviceBrowserDelegate> ImageCaptureDeviceManager::device_browser() { |
| 159 return device_browser_.get(); | 159 return device_browser_.get(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace chrome | 162 } // namespace chrome |
| OLD | NEW |