Revert 264226 "Reduce dependency of TiclInvalidationService on P..."
[chromium-blink-merge.git] / device / bluetooth / bluetooth_profile_mac.h
blob673abeb4969da7a777203ba1649077db387ae249
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_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "device/bluetooth/bluetooth_profile.h"
13 #include "device/bluetooth/bluetooth_uuid.h"
15 #ifdef __OBJC__
16 @class IOBluetoothDevice;
17 #else
18 class IOBluetoothDevice;
19 #endif
21 namespace base {
22 class SequencedTaskRunner;
23 } // namespace base
25 namespace device {
27 class BluetoothProfileMac : public BluetoothProfile {
28 public:
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);
44 private:
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_;
55 } // namespace device
57 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PROFILE_MAC_H_