Chromium Code Reviews| Index: content/common/bluetooth/bluetooth_device.cc |
| diff --git a/content/common/bluetooth/bluetooth_device.cc b/content/common/bluetooth/bluetooth_device.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8524fdfda8c40b251014279ed917fbe83d033069 |
| --- /dev/null |
| +++ b/content/common/bluetooth/bluetooth_device.cc |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/common/bluetooth/bluetooth_device.h" |
| + |
| +#include "base/strings/string_util.h" |
| + |
| +namespace content { |
| + |
| +BluetoothDevice::BluetoothDevice() |
| + : instance_id(""), |
| + 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.
|
| + device_class(0), |
| + vendor_id_source( |
| + device::BluetoothDevice::VendorIDSource::VENDOR_ID_UNKNOWN), |
| + vendor_id(0), |
| + product_id(0), |
| + product_version(0), |
| + paired(false), |
| + connected(false), |
| + uuids() { |
| +} |
| + |
| +BluetoothDevice::BluetoothDevice( |
| + const std::string& instance_id, |
| + const base::string16& name_in, |
| + uint32 device_class, |
| + device::BluetoothDevice::VendorIDSource vendor_id_source, |
| + uint16 vendor_id, |
| + uint16 product_id, |
| + uint16 product_version, |
| + bool paired, |
| + bool connected, |
| + const std::vector<std::string>& uuids) |
| + : instance_id(instance_id), |
| + name(name_in), |
| + device_class(device_class), |
| + vendor_id_source(vendor_id_source), |
| + vendor_id(vendor_id), |
| + product_id(product_id), |
| + product_version(product_version), |
| + paired(paired), |
| + connected(connected), |
| + uuids(uuids) { |
| +} |
| + |
| +BluetoothDevice::~BluetoothDevice() { |
| +} |
| + |
| +// static |
| +std::vector<std::string> BluetoothDevice::UUIDsFromBluetoothUUIDs( |
| + const device::BluetoothDevice::UUIDList& uuid_list) { |
| + 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.
|
| + for (const auto& it : uuid_list) |
| + uuids.push_back(it.canonical_value()); |
| + return uuids; |
| +} |
| + |
| +} // namespace content |