Revert 264226 "Reduce dependency of TiclInvalidationService on P..."
[chromium-blink-merge.git] / device / bluetooth / bluetooth_device_mac.h
blob842a41a5a337bf077028b01c26a7651233670d84
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_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/observer_list.h"
12 #include "device/bluetooth/bluetooth_device.h"
14 #ifdef __OBJC__
15 @class IOBluetoothDevice;
16 #else
17 class IOBluetoothDevice;
18 #endif
20 namespace base {
21 class SequencedTaskRunner;
22 } // namespace base
24 namespace device {
26 class BluetoothDeviceMac : public BluetoothDevice {
27 public:
28 explicit BluetoothDeviceMac(
29 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner,
30 IOBluetoothDevice* device);
31 virtual ~BluetoothDeviceMac();
33 // BluetoothDevice override
34 virtual void AddObserver(
35 device::BluetoothDevice::Observer* observer) OVERRIDE;
36 virtual void RemoveObserver(
37 device::BluetoothDevice::Observer* observer) OVERRIDE;
38 virtual uint32 GetBluetoothClass() const OVERRIDE;
39 virtual std::string GetAddress() const OVERRIDE;
40 virtual VendorIDSource GetVendorIDSource() const OVERRIDE;
41 virtual uint16 GetVendorID() const OVERRIDE;
42 virtual uint16 GetProductID() const OVERRIDE;
43 virtual uint16 GetDeviceID() const OVERRIDE;
44 virtual bool IsPaired() const OVERRIDE;
45 virtual bool IsConnected() const OVERRIDE;
46 virtual bool IsConnectable() const OVERRIDE;
47 virtual bool IsConnecting() const OVERRIDE;
48 virtual UUIDList GetUUIDs() const OVERRIDE;
49 virtual bool ExpectingPinCode() const OVERRIDE;
50 virtual bool ExpectingPasskey() const OVERRIDE;
51 virtual bool ExpectingConfirmation() const OVERRIDE;
52 virtual void Connect(
53 PairingDelegate* pairing_delegate,
54 const base::Closure& callback,
55 const ConnectErrorCallback& error_callback) OVERRIDE;
56 virtual void SetPinCode(const std::string& pincode) OVERRIDE;
57 virtual void SetPasskey(uint32 passkey) OVERRIDE;
58 virtual void ConfirmPairing() OVERRIDE;
59 virtual void RejectPairing() OVERRIDE;
60 virtual void CancelPairing() OVERRIDE;
61 virtual void Disconnect(
62 const base::Closure& callback,
63 const ErrorCallback& error_callback) OVERRIDE;
64 virtual void Forget(const ErrorCallback& error_callback) OVERRIDE;
65 virtual void ConnectToProfile(
66 BluetoothProfile* profile,
67 const base::Closure& callback,
68 const ConnectToProfileErrorCallback& error_callback) OVERRIDE;
69 virtual void SetOutOfBandPairingData(
70 const BluetoothOutOfBandPairingData& data,
71 const base::Closure& callback,
72 const ErrorCallback& error_callback) OVERRIDE;
73 virtual void ClearOutOfBandPairingData(
74 const base::Closure& callback,
75 const ErrorCallback& error_callback) OVERRIDE;
77 protected:
78 // BluetoothDevice override
79 virtual std::string GetDeviceName() const OVERRIDE;
81 private:
82 friend class BluetoothAdapterMac;
84 // List of observers interested in event notifications from us.
85 ObserverList<Observer> observers_;
87 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
88 // (retained)
89 IOBluetoothDevice* device_;
91 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceMac);
94 } // namespace device
96 #endif // DEVICE_BLUETOOTH_BLUETOOTH_DEVICE_MAC_H_