Index: components/proximity_auth/bluetooth_low_energy_advertiser.h |
diff --git a/components/proximity_auth/bluetooth_low_energy_advertiser.h b/components/proximity_auth/bluetooth_low_energy_advertiser.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3c51385808941c1cc51b9cb55a9a8bf385d9b535 |
--- /dev/null |
+++ b/components/proximity_auth/bluetooth_low_energy_advertiser.h |
@@ -0,0 +1,45 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |
+#define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
+#include "device/bluetooth/bluetooth_adapter.h" |
+#include "device/bluetooth/bluetooth_advertisement.h" |
+ |
+namespace proximity_auth { |
+ |
+class BluetoothLowEnergyAdvertiser { |
+ public: |
+ BluetoothLowEnergyAdvertiser(); |
+ ~BluetoothLowEnergyAdvertiser(); |
+ |
+ void Advertise(); |
+ |
+ private: |
+ void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); |
+ void OnAdvertisementRegistered( |
+ scoped_refptr<device::BluetoothAdvertisement> advertisement); |
+ void OnAdvertisementError( |
+ device::BluetoothAdvertisement::ErrorCode error_code); |
+ |
+ // The Bluetooth adapter over which this connection is made. Non-null iff |
+ // |this| connection is registered as an observer of the |adapter_|. |
+ scoped_refptr<device::BluetoothAdapter> adapter_; |
+ |
+ scoped_refptr<device::BluetoothAdvertisement> advertisement_; |
+ |
+ base::WeakPtrFactory<BluetoothLowEnergyAdvertiser> weak_ptr_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAdvertiser); |
+}; |
+ |
+} // namespace proximity_auth |
+ |
+#endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |