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

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

Issue 1284073002: bluetooth: Add adapter to BluetoothDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bt-drop-callback-
Patch Set: Merge TOT Created 5 years, 3 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
« no previous file with comments | « device/bluetooth/bluetooth_classic_device_mac.h ('k') | device/bluetooth/bluetooth_device.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_classic_device_mac.h" 5 #include "device/bluetooth/bluetooth_classic_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 DCHECK_EQ(uuid_str.size(), 32U); 51 DCHECK_EQ(uuid_str.size(), 32U);
52 uuid_str.insert(8, "-"); 52 uuid_str.insert(8, "-");
53 uuid_str.insert(13, "-"); 53 uuid_str.insert(13, "-");
54 uuid_str.insert(18, "-"); 54 uuid_str.insert(18, "-");
55 uuid_str.insert(23, "-"); 55 uuid_str.insert(23, "-");
56 return BluetoothUUID(uuid_str); 56 return BluetoothUUID(uuid_str);
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 60
61 BluetoothClassicDeviceMac::BluetoothClassicDeviceMac(IOBluetoothDevice* device) 61 BluetoothClassicDeviceMac::BluetoothClassicDeviceMac(
62 : device_([device retain]) { 62 BluetoothAdapterMac* adapter,
63 } 63 IOBluetoothDevice* device)
64 : BluetoothDeviceMac(adapter), device_([device retain]) {}
64 65
65 BluetoothClassicDeviceMac::~BluetoothClassicDeviceMac() { 66 BluetoothClassicDeviceMac::~BluetoothClassicDeviceMac() {
66 } 67 }
67 68
68 uint32 BluetoothClassicDeviceMac::GetBluetoothClass() const { 69 uint32 BluetoothClassicDeviceMac::GetBluetoothClass() const {
69 return [device_ classOfDevice]; 70 return [device_ classOfDevice];
70 } 71 }
71 72
72 std::string BluetoothClassicDeviceMac::GetDeviceName() const { 73 std::string BluetoothClassicDeviceMac::GetDeviceName() const {
73 return base::SysNSStringToUTF8([device_ name]); 74 return base::SysNSStringToUTF8([device_ name]);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return power_level; 260 return power_level;
260 } 261 }
261 262
262 // static 263 // static
263 std::string BluetoothClassicDeviceMac::GetDeviceAddress( 264 std::string BluetoothClassicDeviceMac::GetDeviceAddress(
264 IOBluetoothDevice* device) { 265 IOBluetoothDevice* device) {
265 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString])); 266 return CanonicalizeAddress(base::SysNSStringToUTF8([device addressString]));
266 } 267 }
267 268
268 } // namespace device 269 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_classic_device_mac.h ('k') | device/bluetooth/bluetooth_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698