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

Side by Side Diff: device/bluetooth/bluetooth_device_mac.mm

Issue 418483003: device/bluetooth: Move GATT observer methods to BluetoothAdapter::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_device_mac.h ('k') | device/bluetooth/bluetooth_device_win.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_mac.h" 5 #include "device/bluetooth/bluetooth_device_mac.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 } // namespace 57 } // namespace
58 58
59 BluetoothDeviceMac::BluetoothDeviceMac(IOBluetoothDevice* device) 59 BluetoothDeviceMac::BluetoothDeviceMac(IOBluetoothDevice* device)
60 : device_([device retain]) { 60 : device_([device retain]) {
61 } 61 }
62 62
63 BluetoothDeviceMac::~BluetoothDeviceMac() { 63 BluetoothDeviceMac::~BluetoothDeviceMac() {
64 } 64 }
65 65
66 void BluetoothDeviceMac::AddObserver(
67 device::BluetoothDevice::Observer* observer) {
68 DCHECK(observer);
69 observers_.AddObserver(observer);
70 }
71
72 void BluetoothDeviceMac::RemoveObserver(
73 device::BluetoothDevice::Observer* observer) {
74 DCHECK(observer);
75 observers_.RemoveObserver(observer);
76 }
77
78 uint32 BluetoothDeviceMac::GetBluetoothClass() const { 66 uint32 BluetoothDeviceMac::GetBluetoothClass() const {
79 return [device_ classOfDevice]; 67 return [device_ classOfDevice];
80 } 68 }
81 69
82 std::string BluetoothDeviceMac::GetDeviceName() const { 70 std::string BluetoothDeviceMac::GetDeviceName() const {
83 return base::SysNSStringToUTF8([device_ name]); 71 return base::SysNSStringToUTF8([device_ name]);
84 } 72 }
85 73
86 std::string BluetoothDeviceMac::GetAddress() const { 74 std::string BluetoothDeviceMac::GetAddress() const {
87 return GetDeviceAddress(device_); 75 return GetDeviceAddress(device_);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 245
258 return power_level; 246 return power_level;
259 } 247 }
260 248
261 // static 249 // static
262 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) { 250 std::string BluetoothDeviceMac::GetDeviceAddress(IOBluetoothDevice* device) {
263 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); 251 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString]));
264 } 252 }
265 253
266 } // namespace device 254 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device_mac.h ('k') | device/bluetooth/bluetooth_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698