summaryrefslogtreecommitdiffstats
path: root/components/pairing/bluetooth_host_pairing_controller.h
diff options
context:
space:
mode:
authorzork <zork@chromium.org>2014-09-16 18:22:53 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-17 01:23:02 +0000
commit20e0b1a5f52f1cc0ab24becf9d6ec3d4ba84b7c7 (patch)
tree2f83f1742bd79af809e803f2fe9fff2950e66a27 /components/pairing/bluetooth_host_pairing_controller.h
parent9d512d39f67d54651f9eead2d94e8262f8b156f9 (diff)
downloadchromium_src-20e0b1a5f52f1cc0ab24becf9d6ec3d4ba84b7c7.zip
chromium_src-20e0b1a5f52f1cc0ab24becf9d6ec3d4ba84b7c7.tar.gz
chromium_src-20e0b1a5f52f1cc0ab24becf9d6ec3d4ba84b7c7.tar.bz2
Wait for the Bluetooth adapter to be present before starting pairing.
BUG=None Review URL: https://codereview.chromium.org/552983003 Cr-Commit-Position: refs/heads/master@{#295207}
Diffstat (limited to 'components/pairing/bluetooth_host_pairing_controller.h')
-rw-r--r--components/pairing/bluetooth_host_pairing_controller.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/pairing/bluetooth_host_pairing_controller.h b/components/pairing/bluetooth_host_pairing_controller.h
index 4dd0962..05feab1 100644
--- a/components/pairing/bluetooth_host_pairing_controller.h
+++ b/components/pairing/bluetooth_host_pairing_controller.h
@@ -12,6 +12,7 @@
#include "base/threading/thread_checker.h"
#include "components/pairing/host_pairing_controller.h"
#include "components/pairing/proto_decoder.h"
+#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_socket.h"
@@ -28,6 +29,7 @@ namespace pairing_chromeos {
class BluetoothHostPairingController
: public HostPairingController,
public ProtoDecoder::Observer,
+ public device::BluetoothAdapter::Observer,
public device::BluetoothDevice::PairingDelegate {
public:
typedef HostPairingController::Observer Observer;
@@ -42,6 +44,7 @@ class BluetoothHostPairingController
void Reset();
void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
+ void SetName();
void OnSetName();
void OnSetPowered();
void OnCreateService(scoped_refptr<device::BluetoothSocket> socket);
@@ -80,6 +83,10 @@ class BluetoothHostPairingController
const pairing_api::CompleteSetup& message) OVERRIDE;
virtual void OnErrorMessage(const pairing_api::Error& message) OVERRIDE;
+ // BluetoothAdapter::Observer:
+ virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter,
+ bool present) OVERRIDE;
+
// device::BluetoothDevice::PairingDelegate:
virtual void RequestPinCode(device::BluetoothDevice* device) OVERRIDE;
virtual void RequestPasskey(device::BluetoothDevice* device) OVERRIDE;