- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / storage_monitor / image_capture_device_manager.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
6 #define CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
7
8 #import <Foundation/Foundation.h>
9 #include <string>
10
11 #include "base/mac/scoped_nsobject.h"
12 #include "chrome/browser/storage_monitor/storage_monitor.h"
13
14 @protocol ICDeviceBrowserDelegate;
15 @class ImageCaptureDevice;
16 @class ImageCaptureDeviceManagerImpl;
17
18 // Upon creation, begins monitoring for any attached devices using the
19 // ImageCapture API. Notifies clients of the presence of such devices
20 // (i.e. cameras,  USB cards) using the SystemMonitor and makes them
21 // available using |deviceForUUID|.
22 class ImageCaptureDeviceManager {
23  public:
24   ImageCaptureDeviceManager();
25   ~ImageCaptureDeviceManager();
26
27   // The UUIDs passed here are available in the device attach notifications
28   // given through SystemMonitor. They're gotten by cracking the device ID
29   // and taking the unique ID output.
30   static ImageCaptureDevice* deviceForUUID(const std::string& uuid);
31
32   // Returns a weak pointer to the internal ImageCapture interface protocol.
33   id<ICDeviceBrowserDelegate> device_browser();
34
35   // Sets the receiver for device attach/detach notifications.
36   // TODO(gbillock): Move this to be a constructor argument.
37   void SetNotifications(StorageMonitor::Receiver* notifications);
38
39   // Eject the given device. The ID passed is not the device ID, but the
40   // ImageCapture UUID.
41   void EjectDevice(const std::string& uuid,
42                    base::Callback<void(StorageMonitor::EjectStatus)> callback);
43
44  private:
45   base::scoped_nsobject<ImageCaptureDeviceManagerImpl> device_browser_;
46 };
47
48 #endif  // CHROME_BROWSER_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_