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.
5 #include "third_party/mojo/src/mojo/public/cpp/bindings/type_converter.h"
7 #include "device/devices_app/usb/public/interfaces/device.mojom.h"
8 #include "device/devices_app/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/WebUSBDeviceRequestOptions.h"
17 struct TypeConverter
<blink::WebUSBDevice::TransferDirection
,
18 device::usb::TransferDirection
> {
19 static blink::WebUSBDevice::TransferDirection
Convert(
20 const device::usb::TransferDirection
& direction
);
24 struct TypeConverter
<device::usb::TransferDirection
,
25 blink::WebUSBDevice::TransferDirection
> {
26 static device::usb::TransferDirection
Convert(
27 const blink::WebUSBDevice::TransferDirection
& direction
);
31 struct TypeConverter
<device::usb::ControlTransferType
,
32 blink::WebUSBDevice::RequestType
> {
33 static device::usb::ControlTransferType
Convert(
34 const blink::WebUSBDevice::RequestType
& direction
);
38 struct TypeConverter
<device::usb::ControlTransferRecipient
,
39 blink::WebUSBDevice::RequestRecipient
> {
40 static device::usb::ControlTransferRecipient
Convert(
41 const blink::WebUSBDevice::RequestRecipient
& direction
);
45 struct TypeConverter
<device::usb::ControlTransferParamsPtr
,
46 blink::WebUSBDevice::ControlTransferParameters
> {
47 static device::usb::ControlTransferParamsPtr
Convert(
48 const blink::WebUSBDevice::ControlTransferParameters
& parameters
);
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
);
59 struct TypeConverter
<blink::WebUSBDeviceInfo::Endpoint
,
60 device::usb::EndpointInfoPtr
> {
61 static blink::WebUSBDeviceInfo::Endpoint
Convert(
62 const device::usb::EndpointInfoPtr
& info
);
66 struct TypeConverter
<blink::WebUSBDeviceInfo::AlternateInterface
,
67 device::usb::AlternateInterfaceInfoPtr
> {
68 static blink::WebUSBDeviceInfo::AlternateInterface
Convert(
69 const device::usb::AlternateInterfaceInfoPtr
& info
);
73 struct TypeConverter
<blink::WebUSBDeviceInfo::Interface
,
74 device::usb::InterfaceInfoPtr
> {
75 static blink::WebUSBDeviceInfo::Interface
Convert(
76 const device::usb::InterfaceInfoPtr
& info
);
80 struct TypeConverter
<blink::WebUSBDeviceInfo::Configuration
,
81 device::usb::ConfigurationInfoPtr
> {
82 static blink::WebUSBDeviceInfo::Configuration
Convert(
83 const device::usb::ConfigurationInfoPtr
& info
);
87 struct TypeConverter
<blink::WebUSBDeviceInfo
, device::usb::DeviceInfoPtr
> {
88 static blink::WebUSBDeviceInfo
Convert(
89 const device::usb::DeviceInfoPtr
& info
);
93 struct TypeConverter
<device::usb::DeviceFilterPtr
, blink::WebUSBDeviceFilter
> {
94 static device::usb::DeviceFilterPtr
Convert(
95 const blink::WebUSBDeviceFilter
& web_filter
);
99 struct TypeConverter
<device::usb::EnumerationOptionsPtr
,
100 blink::WebUSBDeviceRequestOptions
> {
101 static device::usb::EnumerationOptionsPtr
Convert(
102 const blink::WebUSBDeviceRequestOptions
& web_options
);