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 #include "device/devices_app/usb/type_converters.h" | 5 #include "device/devices_app/usb/type_converters.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 info->serial_number = base::UTF16ToUTF8(device.serial_number()); | 260 info->serial_number = base::UTF16ToUTF8(device.serial_number()); |
261 info->configurations = mojo::Array<device::usb::ConfigurationInfoPtr>::From( | 261 info->configurations = mojo::Array<device::usb::ConfigurationInfoPtr>::From( |
262 device.configurations()); | 262 device.configurations()); |
263 if (device.webusb_allowed_origins()) { | 263 if (device.webusb_allowed_origins()) { |
264 info->webusb_allowed_origins = device::usb::WebUsbDescriptorSet::From( | 264 info->webusb_allowed_origins = device::usb::WebUsbDescriptorSet::From( |
265 *device.webusb_allowed_origins()); | 265 *device.webusb_allowed_origins()); |
266 } | 266 } |
267 return info; | 267 return info; |
268 } | 268 } |
269 | 269 |
270 // static | |
271 device::usb::IsochronousPacketPtr | |
272 TypeConverter<device::usb::IsochronousPacketPtr, | |
273 device::UsbDeviceHandle::IsochronousPacket>:: | |
274 Convert(const device::UsbDeviceHandle::IsochronousPacket& packet) { | |
275 device::usb::IsochronousPacketPtr info = | |
276 device::usb::IsochronousPacket::New(); | |
277 info->length = packet.length; | |
278 info->transferred_length = packet.transferred_length; | |
279 info->status = mojo::ConvertTo<device::usb::TransferStatus>(packet.status); | |
280 return info; | |
281 } | |
282 | |
283 } // namespace mojo | 270 } // namespace mojo |
OLD | NEW |