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

Side by Side Diff: device/usb/usb_device.cc

Issue 1253163005: Try to read BOS and WebUSB descriptors from USB devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 4 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
« no previous file with comments | « device/usb/usb_device.h ('k') | device/usb/usb_device_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "device/usb/usb_device.h" 5 #include "device/usb/usb_device.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "device/usb/webusb_descriptors.h"
8 9
9 namespace device { 10 namespace device {
10 11
11 UsbDevice::UsbDevice(uint16 vendor_id, 12 UsbDevice::UsbDevice(uint16 vendor_id,
12 uint16 product_id, 13 uint16 product_id,
13 const base::string16& manufacturer_string, 14 const base::string16& manufacturer_string,
14 const base::string16& product_string, 15 const base::string16& product_string,
15 const base::string16& serial_number) 16 const base::string16& serial_number)
16 : manufacturer_string_(manufacturer_string), 17 : manufacturer_string_(manufacturer_string),
17 product_string_(product_string), 18 product_string_(product_string),
18 serial_number_(serial_number), 19 serial_number_(serial_number),
19 guid_(base::GenerateGUID()), 20 guid_(base::GenerateGUID()),
20 vendor_id_(vendor_id), 21 vendor_id_(vendor_id),
21 product_id_(product_id) { 22 product_id_(product_id) {
22 } 23 }
23 24
24 UsbDevice::~UsbDevice() { 25 UsbDevice::~UsbDevice() {
25 } 26 }
26 27
27 void UsbDevice::CheckUsbAccess(const ResultCallback& callback) { 28 void UsbDevice::CheckUsbAccess(const ResultCallback& callback) {
28 // By default assume that access to the device is allowed. This is implemented 29 // By default assume that access to the device is allowed. This is implemented
29 // on Chrome OS by checking with permission_broker. 30 // on Chrome OS by checking with permission_broker.
30 callback.Run(true); 31 callback.Run(true);
31 } 32 }
32 33
33 } // namespace device 34 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_device.h ('k') | device/usb/usb_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698