| 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 "content/renderer/usb/type_converters.h" | 5 #include "content/renderer/usb/type_converters.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 device.deviceVersionMinor = info->device_version_minor; | 206 device.deviceVersionMinor = info->device_version_minor; |
| 207 device.deviceVersionSubminor = info->device_version_subminor; | 207 device.deviceVersionSubminor = info->device_version_subminor; |
| 208 if (!info->manufacturer_name.is_null()) { | 208 if (!info->manufacturer_name.is_null()) { |
| 209 device.manufacturerName = | 209 device.manufacturerName = |
| 210 blink::WebString::fromUTF8(info->manufacturer_name); | 210 blink::WebString::fromUTF8(info->manufacturer_name); |
| 211 } | 211 } |
| 212 if (!info->product_name.is_null()) | 212 if (!info->product_name.is_null()) |
| 213 device.productName = blink::WebString::fromUTF8(info->product_name); | 213 device.productName = blink::WebString::fromUTF8(info->product_name); |
| 214 if (!info->serial_number.is_null()) | 214 if (!info->serial_number.is_null()) |
| 215 device.serialNumber = blink::WebString::fromUTF8(info->serial_number); | 215 device.serialNumber = blink::WebString::fromUTF8(info->serial_number); |
| 216 device.activeConfiguration = info->active_configuration; |
| 216 device.configurations = | 217 device.configurations = |
| 217 blink::WebVector<blink::WebUSBDeviceInfo::Configuration>( | 218 blink::WebVector<blink::WebUSBDeviceInfo::Configuration>( |
| 218 info->configurations.size()); | 219 info->configurations.size()); |
| 219 for (size_t i = 0; i < info->configurations.size(); ++i) { | 220 for (size_t i = 0; i < info->configurations.size(); ++i) { |
| 220 device.configurations[i] = | 221 device.configurations[i] = |
| 221 mojo::ConvertTo<blink::WebUSBDeviceInfo::Configuration>( | 222 mojo::ConvertTo<blink::WebUSBDeviceInfo::Configuration>( |
| 222 info->configurations[i]); | 223 info->configurations[i]); |
| 223 } | 224 } |
| 224 return device; | 225 return device; |
| 225 } | 226 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 252 options->filters = mojo::Array<device::usb::DeviceFilterPtr>::New( | 253 options->filters = mojo::Array<device::usb::DeviceFilterPtr>::New( |
| 253 web_options.filters.size()); | 254 web_options.filters.size()); |
| 254 for (size_t i = 0; i < web_options.filters.size(); ++i) { | 255 for (size_t i = 0; i < web_options.filters.size(); ++i) { |
| 255 options->filters[i] = | 256 options->filters[i] = |
| 256 device::usb::DeviceFilter::From(web_options.filters[i]); | 257 device::usb::DeviceFilter::From(web_options.filters[i]); |
| 257 } | 258 } |
| 258 return options; | 259 return options; |
| 259 } | 260 } |
| 260 | 261 |
| 261 } // namespace mojo | 262 } // namespace mojo |
| OLD | NEW |