OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef DEVICE_CORE_DEVICE_CLIENT_H_ | 5 #ifndef DEVICE_CORE_DEVICE_CLIENT_H_ |
6 #define DEVICE_CORE_DEVICE_CLIENT_H_ | 6 #define DEVICE_CORE_DEVICE_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
9 | 10 |
10 namespace device { | 11 namespace device { |
11 | 12 |
12 class HidService; | 13 class HidService; |
13 class UsbService; | 14 class UsbService; |
14 | 15 |
| 16 namespace usb { |
| 17 class DeviceManager; |
| 18 } |
| 19 |
15 // Interface used by consumers of //device APIs to get pointers to the service | 20 // Interface used by consumers of //device APIs to get pointers to the service |
16 // singletons appropriate for a given embedding application. For an example see | 21 // singletons appropriate for a given embedding application. For an example see |
17 // //chrome/browser/chrome_device_client.h. | 22 // //chrome/browser/chrome_device_client.h. |
18 class DeviceClient { | 23 class DeviceClient { |
19 public: | 24 public: |
20 // Construction sets the single instance. | 25 // Construction sets the single instance. |
21 DeviceClient(); | 26 DeviceClient(); |
22 | 27 |
23 // Destruction clears the single instance. | 28 // Destruction clears the single instance. |
24 ~DeviceClient(); | 29 virtual ~DeviceClient(); |
25 | 30 |
26 // Returns the single instance of |this|. | 31 // Returns the single instance of |this|. |
27 static DeviceClient* Get(); | 32 static DeviceClient* Get(); |
28 | 33 |
29 // Returns the UsbService instance for this embedder. | 34 // Returns the UsbService instance for this embedder. |
30 virtual UsbService* GetUsbService(); | 35 virtual UsbService* GetUsbService(); |
31 | 36 |
| 37 // Connects a USB DeviceManager client to a concrete implementation. If |
| 38 // no such implementation is available the request is dropped. |
| 39 virtual void ConnectToUSBDeviceManager( |
| 40 mojo::InterfaceRequest<usb::DeviceManager> request); |
| 41 |
32 // Returns the HidService instance for this embedder. | 42 // Returns the HidService instance for this embedder. |
33 virtual HidService* GetHidService(); | 43 virtual HidService* GetHidService(); |
34 | 44 |
35 private: | 45 private: |
36 DISALLOW_COPY_AND_ASSIGN(DeviceClient); | 46 DISALLOW_COPY_AND_ASSIGN(DeviceClient); |
37 }; | 47 }; |
38 | 48 |
39 } // namespace device | 49 } // namespace device |
40 | 50 |
41 #endif // DEVICE_CORE_DEVICE_CLIENT_H_ | 51 #endif // DEVICE_CORE_DEVICE_CLIENT_H_ |
OLD | NEW |