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