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
3 // found in the LICENSE file.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "device/bluetooth/bluetooth_profile.h"
13 #include "device/bluetooth/bluetooth_uuid.h"
16 @
class IOBluetoothDevice
;
18 class IOBluetoothDevice
;
22 class SequencedTaskRunner
;
27 class BluetoothProfileMac
: public BluetoothProfile
{
29 // BluetoothProfile override.
30 virtual void Unregister() OVERRIDE
;
31 virtual void SetConnectionCallback(
32 const ConnectionCallback
& callback
) OVERRIDE
;
34 typedef base::Callback
<void(const std::string
&)> ErrorCallback
;
36 // Makes an outgoing connection to |device|, calling |callback| on succes or
37 // |error_callback| on error. If successful, this method also calls
38 // |connection_callback_| before calling |callback|.
39 void Connect(const scoped_refptr
<base::SequencedTaskRunner
>& ui_task_runner
,
40 IOBluetoothDevice
* device
,
41 const base::Closure
& callback
,
42 const ErrorCallback
& error_callback
);
45 friend BluetoothProfile
;
47 BluetoothProfileMac(const BluetoothUUID
& uuid
, const std::string
& name
);
48 virtual ~BluetoothProfileMac();
50 const BluetoothUUID uuid_
;
51 const std::string name_
;
52 ConnectionCallback connection_callback_
;
57 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_