[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / storage_monitor / image_capture_device_manager.h
1 // Copyright 2014 The Chromium Authors
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 COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
6 #define COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_
7
8 #import <Foundation/Foundation.h>
9
10 #include <string>
11
12 #include "components/storage_monitor/storage_monitor.h"
13
14 class MTPDeviceDelegateImplMacTest;
15
16 @protocol ICDeviceBrowserDelegate;
17 @class ICDeviceBrowser;
18 @class ImageCaptureDevice;
19 @class ImageCaptureDeviceManagerImpl;
20
21 namespace storage_monitor {
22
23 // Upon creation, begins monitoring for any attached devices using the
24 // ImageCapture API. Notifies clients of the presence of such devices
25 // (i.e. cameras,  USB cards) using the SystemMonitor and makes them
26 // available using |deviceForUUID|.
27 class ImageCaptureDeviceManager {
28  public:
29   ImageCaptureDeviceManager();
30   ~ImageCaptureDeviceManager();
31
32   // The UUIDs passed here are available in the device attach notifications
33   // given through SystemMonitor. They're gotten by cracking the device ID
34   // and taking the unique ID output.
35   static ImageCaptureDevice* deviceForUUID(const std::string& uuid);
36
37   // Returns a weak pointer to the internal ImageCapture interface protocol.
38   id<ICDeviceBrowserDelegate> device_browser_delegate();
39
40   // Sets the receiver for device attach/detach notifications.
41   // TODO(gbillock): Move this to be a constructor argument.
42   void SetNotifications(StorageMonitor::Receiver* notifications);
43
44   // Eject the given device. The ID passed is not the device ID, but the
45   // ImageCapture UUID.
46   void EjectDevice(
47       const std::string& uuid,
48       base::OnceCallback<void(StorageMonitor::EjectStatus)> callback);
49
50  private:
51   ImageCaptureDeviceManagerImpl* __strong device_browser_;
52
53   // Returns a weak pointer to the internal device browser.
54   ICDeviceBrowser* device_browser_for_test();
55   friend class ImageCaptureDeviceManagerTest;
56   friend class ::MTPDeviceDelegateImplMacTest;
57 };
58
59 }  // namespace storage_monitor
60
61 #endif  // COMPONENTS_STORAGE_MONITOR_IMAGE_CAPTURE_DEVICE_MANAGER_H_