Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/common/bluetooth/bluetooth_device.h" | |
| 6 | |
| 7 #include "base/strings/string_util.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 BluetoothDevice::BluetoothDevice() | |
| 12 : instance_id(""), | |
| 13 name(base::EmptyString16()), | |
|
Marijn Kruisselbrink
2015/01/28 21:45:56
From the EmptyString16 documentation: "DO NOT USE
scheib
2015/01/28 22:23:55
Done.
| |
| 14 device_class(0), | |
| 15 vendor_id_source( | |
| 16 device::BluetoothDevice::VendorIDSource::VENDOR_ID_UNKNOWN), | |
| 17 vendor_id(0), | |
| 18 product_id(0), | |
| 19 product_version(0), | |
| 20 paired(false), | |
| 21 connected(false), | |
| 22 uuids() { | |
| 23 } | |
| 24 | |
| 25 BluetoothDevice::BluetoothDevice( | |
| 26 const std::string& instance_id, | |
| 27 const base::string16& name_in, | |
| 28 uint32 device_class, | |
| 29 device::BluetoothDevice::VendorIDSource vendor_id_source, | |
| 30 uint16 vendor_id, | |
| 31 uint16 product_id, | |
| 32 uint16 product_version, | |
| 33 bool paired, | |
| 34 bool connected, | |
| 35 const std::vector<std::string>& uuids) | |
| 36 : instance_id(instance_id), | |
| 37 name(name_in), | |
| 38 device_class(device_class), | |
| 39 vendor_id_source(vendor_id_source), | |
| 40 vendor_id(vendor_id), | |
| 41 product_id(product_id), | |
| 42 product_version(product_version), | |
| 43 paired(paired), | |
| 44 connected(connected), | |
| 45 uuids(uuids) { | |
| 46 } | |
| 47 | |
| 48 BluetoothDevice::~BluetoothDevice() { | |
| 49 } | |
| 50 | |
| 51 // static | |
| 52 std::vector<std::string> BluetoothDevice::UUIDsFromBluetoothUUIDs( | |
| 53 const device::BluetoothDevice::UUIDList& uuid_list) { | |
| 54 std::vector<std::string> uuids(uuid_list.size()); | |
|
Marijn Kruisselbrink
2015/01/28 21:45:56
I think this ends up creating a vector that is twi
scheib
2015/01/28 22:23:55
Done. Thanks, was a bug.
| |
| 55 for (const auto& it : uuid_list) | |
| 56 uuids.push_back(it.canonical_value()); | |
| 57 return uuids; | |
| 58 } | |
| 59 | |
| 60 } // namespace content | |
| OLD | NEW |