| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ADVERTISEMENT_CHROMEOS_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chromeos/dbus/bluetooth_le_advertisement_service_provider.h" | |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 9 #include "device/bluetooth/bluetooth_adapter.h" |
| 11 #include "device/bluetooth/bluetooth_advertisement.h" | 10 #include "device/bluetooth/bluetooth_advertisement.h" |
| 12 #include "device/bluetooth/bluetooth_export.h" | 11 #include "device/bluetooth/bluetooth_export.h" |
| 12 #include "device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.h" |
| 13 |
| 14 namespace bluez { |
| 15 class BluetoothLEAdvertisementServiceProvider; |
| 16 } |
| 13 | 17 |
| 14 namespace chromeos { | 18 namespace chromeos { |
| 15 | 19 |
| 16 class BluetoothLEAdvertisementServiceProvider; | |
| 17 class BluetoothAdapterChromeOS; | 20 class BluetoothAdapterChromeOS; |
| 18 | 21 |
| 19 // The BluetoothAdvertisementChromeOS class implements BluetoothAdvertisement | 22 // The BluetoothAdvertisementChromeOS class implements BluetoothAdvertisement |
| 20 // for the Chrome OS platform. | 23 // for the Chrome OS platform. |
| 21 class DEVICE_BLUETOOTH_EXPORT BluetoothAdvertisementChromeOS | 24 class DEVICE_BLUETOOTH_EXPORT BluetoothAdvertisementChromeOS |
| 22 : public device::BluetoothAdvertisement, | 25 : public device::BluetoothAdvertisement, |
| 23 public BluetoothLEAdvertisementServiceProvider::Delegate { | 26 public bluez::BluetoothLEAdvertisementServiceProvider::Delegate { |
| 24 public: | 27 public: |
| 25 BluetoothAdvertisementChromeOS( | 28 BluetoothAdvertisementChromeOS( |
| 26 scoped_ptr<device::BluetoothAdvertisement::Data> data, | 29 scoped_ptr<device::BluetoothAdvertisement::Data> data, |
| 27 scoped_refptr<BluetoothAdapterChromeOS> adapter); | 30 scoped_refptr<BluetoothAdapterChromeOS> adapter); |
| 28 | 31 |
| 29 // BluetoothAdvertisement overrides: | 32 // BluetoothAdvertisement overrides: |
| 30 void Unregister(const SuccessCallback& success_callback, | 33 void Unregister(const SuccessCallback& success_callback, |
| 31 const ErrorCallback& error_callback) override; | 34 const ErrorCallback& error_callback) override; |
| 32 | 35 |
| 33 // BluetoothLEAdvertisementServiceProvider::Delegate overrides: | 36 // bluez::BluetoothLEAdvertisementServiceProvider::Delegate overrides: |
| 34 void Released() override; | 37 void Released() override; |
| 35 | 38 |
| 36 void Register( | 39 void Register( |
| 37 const base::Closure& success_callback, | 40 const base::Closure& success_callback, |
| 38 const device::BluetoothAdapter::CreateAdvertisementErrorCallback& | 41 const device::BluetoothAdapter::CreateAdvertisementErrorCallback& |
| 39 error_callback); | 42 error_callback); |
| 40 | 43 |
| 41 // Used from tests to be able to trigger events on the fake advertisement | 44 // Used from tests to be able to trigger events on the fake advertisement |
| 42 // provider. | 45 // provider. |
| 43 BluetoothLEAdvertisementServiceProvider* provider() { | 46 bluez::BluetoothLEAdvertisementServiceProvider* provider() { |
| 44 return provider_.get(); | 47 return provider_.get(); |
| 45 } | 48 } |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 ~BluetoothAdvertisementChromeOS() override; | 51 ~BluetoothAdvertisementChromeOS() override; |
| 49 | 52 |
| 50 // Adapter this advertisement is advertising on. | 53 // Adapter this advertisement is advertising on. |
| 51 scoped_refptr<BluetoothAdapterChromeOS> adapter_; | 54 scoped_refptr<BluetoothAdapterChromeOS> adapter_; |
| 52 scoped_ptr<BluetoothLEAdvertisementServiceProvider> provider_; | 55 scoped_ptr<bluez::BluetoothLEAdvertisementServiceProvider> provider_; |
| 53 | 56 |
| 54 DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementChromeOS); | 57 DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementChromeOS); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 } // namespace chromeos | 60 } // namespace chromeos |
| 58 | 61 |
| 59 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_ | 62 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_ |
| OLD | NEW |