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

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 12929003: Implemented BluetoothAdapterMac::AddDevices(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DeviceRemoved obsolete in OSX. Created 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bluetooth/bluetooth_device.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "device/bluetooth/bluetooth_utils.h" 10 #include "device/bluetooth/bluetooth_utils.h"
11 #include "grit/device_bluetooth_strings.h" 11 #include "grit/device_bluetooth_strings.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 13
14 namespace device { 14 namespace device {
15 15
16 // static 16 // static
17 bool BluetoothDevice::IsUUIDValid(const std::string& uuid) { 17 bool BluetoothDevice::IsUUIDValid(const std::string& uuid) {
18 return !bluetooth_utils::CanonicalUuid(uuid).empty(); 18 return !bluetooth_utils::CanonicalUuid(uuid).empty();
19 } 19 }
20 20
21 BluetoothDevice::BluetoothDevice() 21 BluetoothDevice::BluetoothDevice(const std::string& name,
22 : bluetooth_class_(0), 22 const std::string& address,
23 uint32 bluetooth_class,
24 bool connected,
25 bool bonded)
26 : bluetooth_class_(bluetooth_class),
27 name_(name),
28 address_(address),
23 visible_(false), 29 visible_(false),
24 bonded_(false), 30 bonded_(bonded),
25 connected_(false), 31 connected_(connected),
26 connectable_(true), 32 connectable_(true),
27 connecting_(false) { 33 connecting_(false) {
28 } 34 }
29 35
30 BluetoothDevice::~BluetoothDevice() { 36 BluetoothDevice::~BluetoothDevice() {
31 } 37 }
32 38
33 const std::string& BluetoothDevice::address() const { 39 const std::string& BluetoothDevice::address() const {
34 return address_; 40 return address_;
35 } 41 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 for (BluetoothDevice::ServiceList::const_iterator iter = services.begin(); 198 for (BluetoothDevice::ServiceList::const_iterator iter = services.begin();
193 iter != services.end(); 199 iter != services.end();
194 ++iter) { 200 ++iter) {
195 if (bluetooth_utils::CanonicalUuid(*iter) == canonical_uuid) 201 if (bluetooth_utils::CanonicalUuid(*iter) == canonical_uuid)
196 return true; 202 return true;
197 } 203 }
198 return false; 204 return false;
199 } 205 }
200 206
201 } // namespace device 207 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698