| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_USB_MOJO_TYPE_CONVERTERS_H_ | 5 #ifndef DEVICE_USB_MOJO_TYPE_CONVERTERS_H_ |
| 6 #define DEVICE_USB_MOJO_TYPE_CONVERTERS_H_ | 6 #define DEVICE_USB_MOJO_TYPE_CONVERTERS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "device/usb/public/interfaces/device.mojom.h" | 10 #include "device/usb/public/interfaces/device.mojom.h" |
| 11 #include "device/usb/public/interfaces/device_manager.mojom.h" | 11 #include "device/usb/public/interfaces/device_manager.mojom.h" |
| 12 #include "device/usb/usb_descriptors.h" | 12 #include "device/usb/usb_descriptors.h" |
| 13 #include "device/usb/usb_device_filter.h" | 13 #include "device/usb/usb_device_filter.h" |
| 14 #include "device/usb/usb_device_handle.h" | 14 #include "device/usb/usb_device_handle.h" |
| 15 #include "device/usb/webusb_descriptors.h" | |
| 16 #include "mojo/public/cpp/bindings/array.h" | 15 #include "mojo/public/cpp/bindings/array.h" |
| 17 #include "mojo/public/cpp/bindings/type_converter.h" | 16 #include "mojo/public/cpp/bindings/type_converter.h" |
| 18 | 17 |
| 19 // Type converters to translate between internal device/usb data types and | 18 // Type converters to translate between internal device/usb data types and |
| 20 // public Mojo interface data types. This must be included by any source file | 19 // public Mojo interface data types. This must be included by any source file |
| 21 // that uses these conversions explicitly or implicitly. | 20 // that uses these conversions explicitly or implicitly. |
| 22 | 21 |
| 23 namespace device { | 22 namespace device { |
| 24 class UsbDevice; | 23 class UsbDevice; |
| 25 } | 24 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 template <> | 91 template <> |
| 93 struct TypeConverter<device::usb::ConfigurationInfoPtr, | 92 struct TypeConverter<device::usb::ConfigurationInfoPtr, |
| 94 device::UsbConfigDescriptor> { | 93 device::UsbConfigDescriptor> { |
| 95 static device::usb::ConfigurationInfoPtr Convert( | 94 static device::usb::ConfigurationInfoPtr Convert( |
| 96 const device::UsbConfigDescriptor& config); | 95 const device::UsbConfigDescriptor& config); |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 template <> | 98 template <> |
| 100 struct TypeConverter<device::usb::WebUsbFunctionSubsetPtr, | |
| 101 device::WebUsbFunctionSubset> { | |
| 102 static device::usb::WebUsbFunctionSubsetPtr Convert( | |
| 103 const device::WebUsbFunctionSubset& function); | |
| 104 }; | |
| 105 | |
| 106 template <> | |
| 107 struct TypeConverter<device::usb::WebUsbConfigurationSubsetPtr, | |
| 108 device::WebUsbConfigurationSubset> { | |
| 109 static device::usb::WebUsbConfigurationSubsetPtr Convert( | |
| 110 const device::WebUsbConfigurationSubset& config); | |
| 111 }; | |
| 112 | |
| 113 template <> | |
| 114 struct TypeConverter<device::usb::WebUsbDescriptorSetPtr, | |
| 115 device::WebUsbAllowedOrigins> { | |
| 116 static device::usb::WebUsbDescriptorSetPtr Convert( | |
| 117 const device::WebUsbAllowedOrigins& allowed_origins); | |
| 118 }; | |
| 119 | |
| 120 template <> | |
| 121 struct TypeConverter<device::usb::DeviceInfoPtr, device::UsbDevice> { | 99 struct TypeConverter<device::usb::DeviceInfoPtr, device::UsbDevice> { |
| 122 static device::usb::DeviceInfoPtr Convert(const device::UsbDevice& device); | 100 static device::usb::DeviceInfoPtr Convert(const device::UsbDevice& device); |
| 123 }; | 101 }; |
| 124 | 102 |
| 125 template <> | 103 template <> |
| 126 struct TypeConverter<device::usb::IsochronousPacketPtr, | 104 struct TypeConverter<device::usb::IsochronousPacketPtr, |
| 127 device::UsbDeviceHandle::IsochronousPacket> { | 105 device::UsbDeviceHandle::IsochronousPacket> { |
| 128 static device::usb::IsochronousPacketPtr Convert( | 106 static device::usb::IsochronousPacketPtr Convert( |
| 129 const device::UsbDeviceHandle::IsochronousPacket& packet); | 107 const device::UsbDeviceHandle::IsochronousPacket& packet); |
| 130 }; | 108 }; |
| 131 | 109 |
| 132 } // namespace mojo | 110 } // namespace mojo |
| 133 | 111 |
| 134 #endif // DEVICE_DEVICES_APP_USB_TYPE_CONVERTERS_H_ | 112 #endif // DEVICE_DEVICES_APP_USB_TYPE_CONVERTERS_H_ |
| OLD | NEW |