| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/public/cpp/bindings/type_converter.h" | |
| 6 | |
| 7 #include "device/usb/public/interfaces/device.mojom.h" | |
| 8 #include "device/usb/public/interfaces/device_manager.mojom.h" | |
| 9 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDevice.h" | |
| 10 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h
" | |
| 11 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h" | |
| 12 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceRequestO
ptions.h" | |
| 13 | |
| 14 namespace mojo { | |
| 15 | |
| 16 template <> | |
| 17 struct TypeConverter<blink::WebUSBDevice::TransferDirection, | |
| 18 device::usb::TransferDirection> { | |
| 19 static blink::WebUSBDevice::TransferDirection Convert( | |
| 20 const device::usb::TransferDirection& direction); | |
| 21 }; | |
| 22 | |
| 23 template <> | |
| 24 struct TypeConverter<device::usb::TransferDirection, | |
| 25 blink::WebUSBDevice::TransferDirection> { | |
| 26 static device::usb::TransferDirection Convert( | |
| 27 const blink::WebUSBDevice::TransferDirection& direction); | |
| 28 }; | |
| 29 | |
| 30 template <> | |
| 31 struct TypeConverter<device::usb::ControlTransferType, | |
| 32 blink::WebUSBDevice::RequestType> { | |
| 33 static device::usb::ControlTransferType Convert( | |
| 34 const blink::WebUSBDevice::RequestType& direction); | |
| 35 }; | |
| 36 | |
| 37 template <> | |
| 38 struct TypeConverter<device::usb::ControlTransferRecipient, | |
| 39 blink::WebUSBDevice::RequestRecipient> { | |
| 40 static device::usb::ControlTransferRecipient Convert( | |
| 41 const blink::WebUSBDevice::RequestRecipient& direction); | |
| 42 }; | |
| 43 | |
| 44 template <> | |
| 45 struct TypeConverter<device::usb::ControlTransferParamsPtr, | |
| 46 blink::WebUSBDevice::ControlTransferParameters> { | |
| 47 static device::usb::ControlTransferParamsPtr Convert( | |
| 48 const blink::WebUSBDevice::ControlTransferParameters& parameters); | |
| 49 }; | |
| 50 | |
| 51 template <> | |
| 52 struct TypeConverter<blink::WebUSBDeviceInfo::Endpoint::Type, | |
| 53 device::usb::EndpointType> { | |
| 54 static blink::WebUSBDeviceInfo::Endpoint::Type Convert( | |
| 55 const device::usb::EndpointType& endpoint_type); | |
| 56 }; | |
| 57 | |
| 58 template <> | |
| 59 struct TypeConverter<blink::WebUSBDeviceInfo::Endpoint, | |
| 60 device::usb::EndpointInfoPtr> { | |
| 61 static blink::WebUSBDeviceInfo::Endpoint Convert( | |
| 62 const device::usb::EndpointInfoPtr& info); | |
| 63 }; | |
| 64 | |
| 65 template <> | |
| 66 struct TypeConverter<blink::WebUSBDeviceInfo::AlternateInterface, | |
| 67 device::usb::AlternateInterfaceInfoPtr> { | |
| 68 static blink::WebUSBDeviceInfo::AlternateInterface Convert( | |
| 69 const device::usb::AlternateInterfaceInfoPtr& info); | |
| 70 }; | |
| 71 | |
| 72 template <> | |
| 73 struct TypeConverter<blink::WebUSBDeviceInfo::Interface, | |
| 74 device::usb::InterfaceInfoPtr> { | |
| 75 static blink::WebUSBDeviceInfo::Interface Convert( | |
| 76 const device::usb::InterfaceInfoPtr& info); | |
| 77 }; | |
| 78 | |
| 79 template <> | |
| 80 struct TypeConverter<blink::WebUSBDeviceInfo::Configuration, | |
| 81 device::usb::ConfigurationInfoPtr> { | |
| 82 static blink::WebUSBDeviceInfo::Configuration Convert( | |
| 83 const device::usb::ConfigurationInfoPtr& info); | |
| 84 }; | |
| 85 | |
| 86 template <> | |
| 87 struct TypeConverter<blink::WebUSBDeviceInfo, device::usb::DeviceInfoPtr> { | |
| 88 static blink::WebUSBDeviceInfo Convert( | |
| 89 const device::usb::DeviceInfoPtr& info); | |
| 90 }; | |
| 91 | |
| 92 template <> | |
| 93 struct TypeConverter<device::usb::DeviceFilterPtr, blink::WebUSBDeviceFilter> { | |
| 94 static device::usb::DeviceFilterPtr Convert( | |
| 95 const blink::WebUSBDeviceFilter& web_filter); | |
| 96 }; | |
| 97 | |
| 98 template <> | |
| 99 struct TypeConverter<device::usb::EnumerationOptionsPtr, | |
| 100 blink::WebUSBDeviceRequestOptions> { | |
| 101 static device::usb::EnumerationOptionsPtr Convert( | |
| 102 const blink::WebUSBDeviceRequestOptions& web_options); | |
| 103 }; | |
| 104 | |
| 105 } // namespace mojo | |
| OLD | NEW |