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

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

Issue 220323004: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialized |empty_device_| in BluetoothDeviceWinTest. Created 6 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_profile_mac.h ('k') | device/bluetooth/bluetooth_profile_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_profile_mac.h" 5 #include "device/bluetooth/bluetooth_profile_mac.h"
6 6
7 #import <IOBluetooth/objc/IOBluetoothDevice.h> 7 #import <IOBluetooth/objc/IOBluetoothDevice.h>
8 #import <IOBluetooth/objc/IOBluetoothSDPServiceRecord.h> 8 #import <IOBluetooth/objc/IOBluetoothSDPServiceRecord.h>
9 #import <IOBluetooth/objc/IOBluetoothSDPUUID.h> 9 #import <IOBluetooth/objc/IOBluetoothSDPUUID.h>
10 10
(...skipping 28 matching lines...) Expand all
39 DCHECK(uuid_bytes_vector.size() == 16); 39 DCHECK(uuid_bytes_vector.size() == 16);
40 40
41 return [IOBluetoothSDPUUID uuidWithBytes:&uuid_bytes_vector[0] 41 return [IOBluetoothSDPUUID uuidWithBytes:&uuid_bytes_vector[0]
42 length:uuid_bytes_vector.size()]; 42 length:uuid_bytes_vector.size()];
43 } 43 }
44 44
45 } // namespace 45 } // namespace
46 46
47 namespace device { 47 namespace device {
48 48
49 BluetoothProfileMac::BluetoothProfileMac(const std::string& uuid, 49 BluetoothProfileMac::BluetoothProfileMac(const BluetoothUUID& uuid,
50 const std::string& name) 50 const std::string& name)
51 : BluetoothProfile(), uuid_(uuid), name_(name) { 51 : BluetoothProfile(), uuid_(uuid), name_(name) {
52 } 52 }
53 53
54 BluetoothProfileMac::~BluetoothProfileMac() { 54 BluetoothProfileMac::~BluetoothProfileMac() {
55 } 55 }
56 56
57 void BluetoothProfileMac::Unregister() { 57 void BluetoothProfileMac::Unregister() {
58 delete this; 58 delete this;
59 } 59 }
60 60
61 void BluetoothProfileMac::SetConnectionCallback( 61 void BluetoothProfileMac::SetConnectionCallback(
62 const ConnectionCallback& callback) { 62 const ConnectionCallback& callback) {
63 connection_callback_ = callback; 63 connection_callback_ = callback;
64 } 64 }
65 65
66 bool BluetoothProfileMac::Connect(IOBluetoothDevice* device) { 66 bool BluetoothProfileMac::Connect(IOBluetoothDevice* device) {
67 if (connection_callback_.is_null()) 67 if (connection_callback_.is_null())
68 return false; 68 return false;
69 69
70 IOBluetoothSDPServiceRecord* record = 70 IOBluetoothSDPServiceRecord* record =
71 [device getServiceRecordForUUID:GetIOBluetoothSDPUUID(uuid_)]; 71 [device getServiceRecordForUUID:GetIOBluetoothSDPUUID(
72 uuid_.canonical_value())];
72 if (record != nil) { 73 if (record != nil) {
73 scoped_refptr<BluetoothSocket> socket( 74 scoped_refptr<BluetoothSocket> socket(
74 BluetoothSocketMac::CreateBluetoothSocket(record)); 75 BluetoothSocketMac::CreateBluetoothSocket(record));
75 if (socket.get() != NULL) { 76 if (socket.get() != NULL) {
76 BluetoothDeviceMac device_mac(device); 77 BluetoothDeviceMac device_mac(device);
77 connection_callback_.Run(&device_mac, socket); 78 connection_callback_.Run(&device_mac, socket);
78 return true; 79 return true;
79 } 80 }
80 } 81 }
81 return false; 82 return false;
82 } 83 }
83 84
84 } // namespace device 85 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_profile_mac.h ('k') | device/bluetooth/bluetooth_profile_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698