OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |
| 6 #define COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "device/bluetooth/bluetooth_adapter.h" |
| 14 #include "device/bluetooth/bluetooth_advertisement.h" |
| 15 |
| 16 namespace proximity_auth { |
| 17 |
| 18 class BluetoothLowEnergyAdvertiser { |
| 19 public: |
| 20 BluetoothLowEnergyAdvertiser(); |
| 21 ~BluetoothLowEnergyAdvertiser(); |
| 22 |
| 23 void Advertise(); |
| 24 |
| 25 private: |
| 26 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); |
| 27 void OnAdvertisementRegistered( |
| 28 scoped_refptr<device::BluetoothAdvertisement> advertisement); |
| 29 void OnAdvertisementError( |
| 30 device::BluetoothAdvertisement::ErrorCode error_code); |
| 31 |
| 32 // The Bluetooth adapter over which this connection is made. Non-null iff |
| 33 // |this| connection is registered as an observer of the |adapter_|. |
| 34 scoped_refptr<device::BluetoothAdapter> adapter_; |
| 35 |
| 36 scoped_refptr<device::BluetoothAdvertisement> advertisement_; |
| 37 |
| 38 base::WeakPtrFactory<BluetoothLowEnergyAdvertiser> weak_ptr_factory_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyAdvertiser); |
| 41 }; |
| 42 |
| 43 } // namespace proximity_auth |
| 44 |
| 45 #endif // COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_ADVERTISER_H |
OLD | NEW |