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_TEST_USB_TEST_GADGET_H_ | 5 #ifndef DEVICE_TEST_USB_TEST_GADGET_H_ |
6 #define DEVICE_TEST_USB_TEST_GADGET_H_ | 6 #define DEVICE_TEST_USB_TEST_GADGET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 | 12 |
13 namespace usb_service { | 13 namespace usb_service { |
14 class UsbDevice; | 14 class UsbDevice; |
15 } // namespace usb_service | 15 } // namespace usb_service |
16 | 16 |
17 namespace device { | 17 namespace device { |
18 | 18 |
19 class UsbTestGadget { | 19 class UsbTestGadget { |
20 public: | 20 public: |
21 enum Type { | 21 enum Type { |
22 DEFAULT = 0, | 22 DEFAULT = 0, |
23 KEYBOARD, | 23 KEYBOARD, |
24 MOUSE, | 24 MOUSE, |
| 25 HID_ECHO, |
25 }; | 26 }; |
26 | 27 |
27 virtual ~UsbTestGadget() {} | 28 virtual ~UsbTestGadget() {} |
28 | 29 |
29 static bool IsTestEnabled(); | 30 static bool IsTestEnabled(); |
30 static scoped_ptr<UsbTestGadget> Claim(); | 31 static scoped_ptr<UsbTestGadget> Claim(); |
31 | 32 |
32 virtual bool Unclaim() = 0; | 33 virtual bool Unclaim() = 0; |
33 virtual bool Disconnect() = 0; | 34 virtual bool Disconnect() = 0; |
34 virtual bool Reconnect() = 0; | 35 virtual bool Reconnect() = 0; |
35 virtual bool SetType(Type type) = 0; | 36 virtual bool SetType(Type type) = 0; |
36 | 37 |
37 virtual usb_service::UsbDevice* GetDevice() const = 0; | 38 virtual usb_service::UsbDevice* GetDevice() const = 0; |
38 virtual std::string GetSerial() const = 0; | 39 virtual std::string GetSerial() const = 0; |
39 | 40 |
40 protected: | 41 protected: |
41 UsbTestGadget() {} | 42 UsbTestGadget() {} |
42 | 43 |
43 private: | 44 private: |
44 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget); | 45 DISALLOW_COPY_AND_ASSIGN(UsbTestGadget); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace device | 48 } // namespace device |
48 | 49 |
49 #endif // DEVICE_TEST_USB_TEST_GADGET_H_ | 50 #endif // DEVICE_TEST_USB_TEST_GADGET_H_ |
OLD | NEW |