reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 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. |
| 4 | |
alexis.menard | 2fe63eaa | 2016-10-13 21:42:43 | [diff] [blame] | 5 | #ifndef DEVICE_BASE_DEVICE_CLIENT_H_ |
| 6 | #define DEVICE_BASE_DEVICE_CLIENT_H_ |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 7 | |
| 8 | #include "base/macros.h" |
alexis.menard | 2fe63eaa | 2016-10-13 21:42:43 | [diff] [blame] | 9 | #include "device/base/device_base_export.h" |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 10 | |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 11 | namespace device { |
| 12 | |
rockot | 1a51b92 | 2014-09-05 08:02:44 | [diff] [blame] | 13 | class HidService; |
reillyg | d77718d | 2014-09-04 00:57:56 | [diff] [blame] | 14 | class UsbService; |
| 15 | |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 16 | // Interface used by consumers of //device APIs to get pointers to the service |
| 17 | // singletons appropriate for a given embedding application. For an example see |
| 18 | // //chrome/browser/chrome_device_client.h. |
alexis.menard | 2fe63eaa | 2016-10-13 21:42:43 | [diff] [blame] | 19 | class DEVICE_BASE_EXPORT DeviceClient { |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 20 | public: |
| 21 | // Construction sets the single instance. |
| 22 | DeviceClient(); |
| 23 | |
| 24 | // Destruction clears the single instance. |
rockot | 8fcc275 | 2015-05-28 02:07:55 | [diff] [blame] | 25 | virtual ~DeviceClient(); |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 26 | |
| 27 | // Returns the single instance of |this|. |
| 28 | static DeviceClient* Get(); |
| 29 | |
| 30 | // Returns the UsbService instance for this embedder. |
reillyg | d77718d | 2014-09-04 00:57:56 | [diff] [blame] | 31 | virtual UsbService* GetUsbService(); |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 32 | |
rockot | 1a51b92 | 2014-09-05 08:02:44 | [diff] [blame] | 33 | // Returns the HidService instance for this embedder. |
| 34 | virtual HidService* GetHidService(); |
| 35 | |
reillyg | e471fab | 2014-08-29 01:58:43 | [diff] [blame] | 36 | private: |
| 37 | DISALLOW_COPY_AND_ASSIGN(DeviceClient); |
| 38 | }; |
| 39 | |
| 40 | } // namespace device |
| 41 | |
alexis.menard | 2fe63eaa | 2016-10-13 21:42:43 | [diff] [blame] | 42 | #endif // DEVICE_BASE_DEVICE_CLIENT_H_ |