1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
6 #define COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
8 #import <Foundation/Foundation.h>
11 #include "base/mac/scoped_nsobject.h"
12 #include "components/storage_monitor/storage_monitor.h"
14 @protocol ICDeviceBrowserDelegate
;
15 @
class ImageCaptureDevice
;
16 @
class ImageCaptureDeviceManagerImpl
;
18 namespace storage_monitor
{
20 // Upon creation, begins monitoring for any attached devices using the
21 // ImageCapture API. Notifies clients of the presence of such devices
22 // (i.e. cameras, USB cards) using the SystemMonitor and makes them
23 // available using |deviceForUUID|.
24 class ImageCaptureDeviceManager
{
26 ImageCaptureDeviceManager();
27 ~ImageCaptureDeviceManager();
29 // The UUIDs passed here are available in the device attach notifications
30 // given through SystemMonitor. They're gotten by cracking the device ID
31 // and taking the unique ID output.
32 static ImageCaptureDevice
* deviceForUUID(const std::string
& uuid
);
34 // Returns a weak pointer to the internal ImageCapture interface protocol.
35 id
<ICDeviceBrowserDelegate
> device_browser();
37 // Sets the receiver for device attach/detach notifications.
38 // TODO(gbillock): Move this to be a constructor argument.
39 void SetNotifications(StorageMonitor::Receiver
* notifications
);
41 // Eject the given device. The ID passed is not the device ID, but the
43 void EjectDevice(const std::string
& uuid
,
44 base::Callback
<void(StorageMonitor::EjectStatus
)> callback
);
47 base::scoped_nsobject
<ImageCaptureDeviceManagerImpl
> device_browser_
;
50 } // namespace storage_monitor
52 #endif // COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_