Chromium Code Reviews| 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/usb/mock_usb_device.h" | 5 #include "device/usb/mock_usb_device.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 | 8 |
| 9 namespace device { | 9 namespace device { |
| 10 | 10 |
| 11 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, uint16_t product_id) | 11 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, uint16_t product_id) |
| 12 : MockUsbDevice(vendor_id, product_id, "", "", "") {} | 12 : MockUsbDevice(vendor_id, product_id, "", "", "") {} |
| 13 | 13 |
| 14 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, | 14 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, |
| 15 uint16_t product_id, | 15 uint16_t product_id, |
| 16 const std::string& manufacturer_string, | 16 const std::string& manufacturer_string, |
| 17 const std::string& product_string, | 17 const std::string& product_string, |
| 18 const std::string& serial_number) | 18 const std::string& serial_number) |
| 19 : UsbDevice(vendor_id, | 19 : UsbDevice(0x0200, |
| 20 0xff, | |
| 21 0xff, | |
| 22 0xff, | |
|
asargent_no_longer_on_chrome
2016/04/04 23:52:28
optional: consider adding comments with the field
| |
| 23 vendor_id, | |
| 20 product_id, | 24 product_id, |
| 25 0x0100, | |
| 21 base::UTF8ToUTF16(manufacturer_string), | 26 base::UTF8ToUTF16(manufacturer_string), |
| 22 base::UTF8ToUTF16(product_string), | 27 base::UTF8ToUTF16(product_string), |
| 23 base::UTF8ToUTF16(serial_number)) {} | 28 base::UTF8ToUTF16(serial_number)) {} |
| 24 | 29 |
| 25 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, | 30 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, |
| 26 uint16_t product_id, | 31 uint16_t product_id, |
| 27 const std::string& manufacturer_string, | 32 const std::string& manufacturer_string, |
| 28 const std::string& product_string, | 33 const std::string& product_string, |
| 29 const std::string& serial_number, | 34 const std::string& serial_number, |
| 30 const GURL& webusb_landing_page) | 35 const GURL& webusb_landing_page) |
| 31 : UsbDevice(vendor_id, | 36 : UsbDevice(0x0200, |
| 37 0xff, | |
| 38 0xff, | |
| 39 0xff, | |
| 40 vendor_id, | |
| 32 product_id, | 41 product_id, |
| 42 0x0100, | |
| 33 base::UTF8ToUTF16(manufacturer_string), | 43 base::UTF8ToUTF16(manufacturer_string), |
| 34 base::UTF8ToUTF16(product_string), | 44 base::UTF8ToUTF16(product_string), |
| 35 base::UTF8ToUTF16(serial_number)) { | 45 base::UTF8ToUTF16(serial_number)) { |
| 36 webusb_landing_page_ = webusb_landing_page; | 46 webusb_landing_page_ = webusb_landing_page; |
| 37 } | 47 } |
| 38 | 48 |
| 39 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, | 49 MockUsbDevice::MockUsbDevice(uint16_t vendor_id, |
| 40 uint16_t product_id, | 50 uint16_t product_id, |
| 41 const UsbConfigDescriptor& configuration) | 51 const UsbConfigDescriptor& configuration) |
| 42 : MockUsbDevice(vendor_id, product_id) { | 52 : MockUsbDevice(vendor_id, product_id) { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 59 } | 69 } |
| 60 | 70 |
| 61 MockUsbDevice::~MockUsbDevice() { | 71 MockUsbDevice::~MockUsbDevice() { |
| 62 } | 72 } |
| 63 | 73 |
| 64 void MockUsbDevice::NotifyDeviceRemoved() { | 74 void MockUsbDevice::NotifyDeviceRemoved() { |
| 65 UsbDevice::NotifyDeviceRemoved(); | 75 UsbDevice::NotifyDeviceRemoved(); |
| 66 } | 76 } |
| 67 | 77 |
| 68 } // namespace device | 78 } // namespace device |
| OLD | NEW |