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

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

Issue 13224004: Bluetooth: remove private members from BluetoothAdapter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_adapter_chromeos.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 (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_adapter.h" 5 #include "device/bluetooth/bluetooth_adapter.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "device/bluetooth/bluetooth_device.h" 8 #include "device/bluetooth/bluetooth_device.h"
9 9
10 namespace device { 10 namespace device {
11 11
12 BluetoothAdapter::BluetoothAdapter() { 12 BluetoothAdapter::BluetoothAdapter() {
13 } 13 }
14 14
15 BluetoothAdapter::~BluetoothAdapter() { 15 BluetoothAdapter::~BluetoothAdapter() {
16 STLDeleteValues(&devices_); 16 STLDeleteValues(&devices_);
17 } 17 }
18 18
19 const std::string& BluetoothAdapter::address() const {
20 return address_;
21 }
22
23 const std::string& BluetoothAdapter::name() const {
24 return name_;
25 }
26
27 BluetoothAdapter::DeviceList BluetoothAdapter::GetDevices() { 19 BluetoothAdapter::DeviceList BluetoothAdapter::GetDevices() {
28 ConstDeviceList const_devices = 20 ConstDeviceList const_devices =
29 const_cast<const BluetoothAdapter *>(this)->GetDevices(); 21 const_cast<const BluetoothAdapter *>(this)->GetDevices();
30 22
31 DeviceList devices; 23 DeviceList devices;
32 for (ConstDeviceList::const_iterator i = const_devices.begin(); 24 for (ConstDeviceList::const_iterator i = const_devices.begin();
33 i != const_devices.end(); ++i) 25 i != const_devices.end(); ++i)
34 devices.push_back(const_cast<BluetoothDevice *>(*i)); 26 devices.push_back(const_cast<BluetoothDevice *>(*i));
35 27
36 return devices; 28 return devices;
(...skipping 17 matching lines...) Expand all
54 const BluetoothDevice* BluetoothAdapter::GetDevice( 46 const BluetoothDevice* BluetoothAdapter::GetDevice(
55 const std::string& address) const { 47 const std::string& address) const {
56 DevicesMap::const_iterator iter = devices_.find(address); 48 DevicesMap::const_iterator iter = devices_.find(address);
57 if (iter != devices_.end()) 49 if (iter != devices_.end())
58 return iter->second; 50 return iter->second;
59 51
60 return NULL; 52 return NULL;
61 } 53 }
62 54
63 } // namespace device 55 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter.h ('k') | device/bluetooth/bluetooth_adapter_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698