OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PAIRING_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_PAIRING_CHROMEOS_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_PAIRING_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_PAIRING_CHROMEOS_H_ |
7 | 7 |
8 #include "chromeos/dbus/bluetooth_agent_service_provider.h" | 8 #include "chromeos/dbus/bluetooth_agent_service_provider.h" |
9 #include "device/bluetooth/bluetooth_device.h" | 9 #include "device/bluetooth/bluetooth_device.h" |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool RejectPairing(); | 101 bool RejectPairing(); |
102 | 102 |
103 // Cancels a pairing or connection attempt to a remote device, returns | 103 // Cancels a pairing or connection attempt to a remote device, returns |
104 // false if there was no way to cancel the pairing. | 104 // false if there was no way to cancel the pairing. |
105 bool CancelPairing(); | 105 bool CancelPairing(); |
106 | 106 |
107 // Returns the pairing delegate being used by this pairing object. | 107 // Returns the pairing delegate being used by this pairing object. |
108 device::BluetoothDevice::PairingDelegate* GetPairingDelegate() const; | 108 device::BluetoothDevice::PairingDelegate* GetPairingDelegate() const; |
109 | 109 |
110 private: | 110 private: |
| 111 // Internal method to reset the current set of callbacks because a new |
| 112 // request has arrived that supercedes them. |
| 113 void ResetCallbacks(); |
| 114 |
111 // Internal method to respond to the relevant callback for a RejectPairing | 115 // Internal method to respond to the relevant callback for a RejectPairing |
112 // or CancelPairing call. | 116 // or CancelPairing call. |
113 bool RunPairingCallbacks( | 117 bool RunPairingCallbacks( |
114 BluetoothAgentServiceProvider::Delegate::Status status); | 118 BluetoothAgentServiceProvider::Delegate::Status status); |
115 | 119 |
116 // The underlying BluetoothDeviceChromeOS that owns this pairing context. | 120 // The underlying BluetoothDeviceChromeOS that owns this pairing context. |
117 BluetoothDeviceChromeOS* device_; | 121 BluetoothDeviceChromeOS* device_; |
118 | 122 |
119 // UI Pairing Delegate to make method calls on, this must live as long as | 123 // UI Pairing Delegate to make method calls on, this must live as long as |
120 // the object capturing the PairingContext. | 124 // the object capturing the PairingContext. |
(...skipping 12 matching lines...) Expand all Loading... |
133 BluetoothAgentServiceProvider::Delegate::PasskeyCallback passkey_callback_; | 137 BluetoothAgentServiceProvider::Delegate::PasskeyCallback passkey_callback_; |
134 BluetoothAgentServiceProvider::Delegate::ConfirmationCallback | 138 BluetoothAgentServiceProvider::Delegate::ConfirmationCallback |
135 confirmation_callback_; | 139 confirmation_callback_; |
136 | 140 |
137 DISALLOW_COPY_AND_ASSIGN(BluetoothPairingChromeOS); | 141 DISALLOW_COPY_AND_ASSIGN(BluetoothPairingChromeOS); |
138 }; | 142 }; |
139 | 143 |
140 } // namespace chromeos | 144 } // namespace chromeos |
141 | 145 |
142 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PAIRING_CHROMEOS_H_ | 146 #endif // DEVICE_BLUETOOTH_BLUETOOTH_PAIRING_CHROMEOS_H_ |
OLD | NEW |