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