third_party: Add OWNERS for re2 library.
[chromium-blink-merge.git] / device / bluetooth / bluetooth_advertisement_chromeos.h
blobaeb59b7c17d96e3557812db1c323de079835a434
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.
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_
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"
14 namespace chromeos {
16 class BluetoothLEAdvertisementServiceProvider;
17 class BluetoothAdapterChromeOS;
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);
29 // BluetoothAdvertisement overrides:
30 void Unregister(const SuccessCallback& success_callback,
31 const ErrorCallback& error_callback) override;
33 // BluetoothLEAdvertisementServiceProvider::Delegate overrides:
34 void Released() override;
36 void Register(
37 const base::Closure& success_callback,
38 const device::BluetoothAdapter::CreateAdvertisementErrorCallback&
39 error_callback);
41 // Used from tests to be able to trigger events on the fake advertisement
42 // provider.
43 BluetoothLEAdvertisementServiceProvider* provider() {
44 return provider_.get();
47 private:
48 ~BluetoothAdvertisementChromeOS() override;
50 // Adapter this advertisement is advertising on.
51 scoped_refptr<BluetoothAdapterChromeOS> adapter_;
52 scoped_ptr<BluetoothLEAdvertisementServiceProvider> provider_;
54 DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementChromeOS);
57 } // namespace chromeos
59 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_