Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Side by Side Diff: content/renderer/usb/type_converters.cc

Issue 1784733002: Track USB device configuration state in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink_open_state
Patch Set: Rebased. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/usb/android_usb_browsertest.cc ('k') | content/renderer/usb/web_usb_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698