OLD | NEW |
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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "device/bluetooth/bluetooth_profile.h" | 12 #include "device/bluetooth/bluetooth_profile.h" |
13 #include "device/bluetooth/bluetooth_uuid.h" | |
14 | 13 |
15 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
16 @class IOBluetoothDevice; | 15 @class IOBluetoothDevice; |
17 #else | 16 #else |
18 class IOBluetoothDevice; | 17 class IOBluetoothDevice; |
19 #endif | 18 #endif |
20 | 19 |
21 namespace device { | 20 namespace device { |
22 | 21 |
23 class BluetoothProfileMac : public BluetoothProfile { | 22 class BluetoothProfileMac : public BluetoothProfile { |
24 public: | 23 public: |
25 // BluetoothProfile override. | 24 // BluetoothProfile override. |
26 virtual void Unregister() OVERRIDE; | 25 virtual void Unregister() OVERRIDE; |
27 virtual void SetConnectionCallback( | 26 virtual void SetConnectionCallback( |
28 const ConnectionCallback& callback) OVERRIDE; | 27 const ConnectionCallback& callback) OVERRIDE; |
29 | 28 |
30 // Makes an outgoing connection to |device|. | 29 // Makes an outgoing connection to |device|. |
31 // This method runs |socket_callback_| with the socket and returns true if the | 30 // This method runs |socket_callback_| with the socket and returns true if the |
32 // connection is made successfully. | 31 // connection is made successfully. |
33 bool Connect(IOBluetoothDevice* device); | 32 bool Connect(IOBluetoothDevice* device); |
34 | 33 |
35 private: | 34 private: |
36 friend BluetoothProfile; | 35 friend BluetoothProfile; |
37 | 36 |
38 BluetoothProfileMac(const BluetoothUUID& uuid, const std::string& name); | 37 BluetoothProfileMac(const std::string& uuid, const std::string& name); |
39 virtual ~BluetoothProfileMac(); | 38 virtual ~BluetoothProfileMac(); |
40 | 39 |
41 const BluetoothUUID uuid_; | 40 const std::string uuid_; |
42 const std::string name_; | 41 const std::string name_; |
43 ConnectionCallback connection_callback_; | 42 ConnectionCallback connection_callback_; |
44 }; | 43 }; |
45 | 44 |
46 } // namespace device | 45 } // namespace device |
47 | 46 |
48 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ | 47 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_ |
OLD | NEW |