Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: components/pairing/bluetooth_host_pairing_controller.h

Issue 552983003: Wait for the Bluetooth adapter to be present before starting pairing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/pairing/bluetooth_host_pairing_controller.h
diff --git a/components/pairing/bluetooth_host_pairing_controller.h b/components/pairing/bluetooth_host_pairing_controller.h
index 4dd0962565a743b0612933af04040a3707e600e9..38e571b1ca58728830600ec1cdd4124ffd444c17 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);
+
// device::BluetoothDevice::PairingDelegate:
virtual void RequestPinCode(device::BluetoothDevice* device) OVERRIDE;
virtual void RequestPasskey(device::BluetoothDevice* device) OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698