Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: device/bluetooth/bluetooth_advertisement_chromeos.h

Issue 1108403002: Revert of Revert of Add CPP API for BLE advertisments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_advertisement.cc ('k') | device/bluetooth/bluetooth_advertisement_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_advertisement_chromeos.h
diff --git a/device/bluetooth/bluetooth_advertisement_chromeos.h b/device/bluetooth/bluetooth_advertisement_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..aeb59b7c17d96e3557812db1c323de079835a434
--- /dev/null
+++ b/device/bluetooth/bluetooth_advertisement_chromeos.h
@@ -0,0 +1,59 @@
+// Copyright 2015 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 DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_
+#define DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_
+
+#include "base/macros.h"
+#include "chromeos/dbus/bluetooth_le_advertisement_service_provider.h"
+#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/bluetooth_advertisement.h"
+#include "device/bluetooth/bluetooth_export.h"
+
+namespace chromeos {
+
+class BluetoothLEAdvertisementServiceProvider;
+class BluetoothAdapterChromeOS;
+
+// The BluetoothAdvertisementChromeOS class implements BluetoothAdvertisement
+// for the Chrome OS platform.
+class DEVICE_BLUETOOTH_EXPORT BluetoothAdvertisementChromeOS
+ : public device::BluetoothAdvertisement,
+ public BluetoothLEAdvertisementServiceProvider::Delegate {
+ public:
+ BluetoothAdvertisementChromeOS(
+ scoped_ptr<device::BluetoothAdvertisement::Data> data,
+ scoped_refptr<BluetoothAdapterChromeOS> adapter);
+
+ // BluetoothAdvertisement overrides:
+ void Unregister(const SuccessCallback& success_callback,
+ const ErrorCallback& error_callback) override;
+
+ // BluetoothLEAdvertisementServiceProvider::Delegate overrides:
+ void Released() override;
+
+ void Register(
+ const base::Closure& success_callback,
+ const device::BluetoothAdapter::CreateAdvertisementErrorCallback&
+ error_callback);
+
+ // Used from tests to be able to trigger events on the fake advertisement
+ // provider.
+ BluetoothLEAdvertisementServiceProvider* provider() {
+ return provider_.get();
+ }
+
+ private:
+ ~BluetoothAdvertisementChromeOS() override;
+
+ // Adapter this advertisement is advertising on.
+ scoped_refptr<BluetoothAdapterChromeOS> adapter_;
+ scoped_ptr<BluetoothLEAdvertisementServiceProvider> provider_;
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementChromeOS);
+};
+
+} // namespace chromeos
+
+#endif // DEVICE_BLUETOOTH_BLUETOOTH_ADVERTISEMENT_CHROMEOS_H_
« no previous file with comments | « device/bluetooth/bluetooth_advertisement.cc ('k') | device/bluetooth/bluetooth_advertisement_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698