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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_private_api.h

Issue 1419023004: Add bluetoothPrivate.connect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_543294_bluetooth_options_2b_props
Patch Set: Rebase Created 5 years, 1 month 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
Index: extensions/browser/api/bluetooth/bluetooth_private_api.h
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.h b/extensions/browser/api/bluetooth/bluetooth_private_api.h
index 6e3af7204d853796af8b3eb28bbd81413ef0888e..887d18ae21c2b330511e933762d99aa3ebbf5d59 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_api.h
+++ b/extensions/browser/api/bluetooth/bluetooth_private_api.h
@@ -6,6 +6,7 @@
#define EXTENSIONS_BROWSER_API_BLUETOOTH_BLUETOOTH_PRIVATE_API_H_
#include "base/callback_forward.h"
+#include "base/macros.h"
#include "device/bluetooth/bluetooth_device.h"
#include "extensions/browser/api/bluetooth/bluetooth_extension_function.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
@@ -128,6 +129,24 @@ class BluetoothPrivateSetDiscoveryFilterFunction
void OnErrorCallback();
};
+class BluetoothPrivateConnectFunction : public BluetoothExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.connect",
+ BLUETOOTHPRIVATE_CONNECT)
+ BluetoothPrivateConnectFunction();
+
+ // BluetoothExtensionFunction:
+ bool DoWork(scoped_refptr<device::BluetoothAdapter> adapter) override;
+
+ private:
+ ~BluetoothPrivateConnectFunction() override;
+
+ void OnSuccessCallback();
+ void OnErrorCallback(device::BluetoothDevice::ConnectErrorCode error);
+
+ DISALLOW_COPY_AND_ASSIGN(BluetoothPrivateConnectFunction);
+};
+
class BluetoothPrivatePairFunction : public BluetoothExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("bluetoothPrivate.pair", BLUETOOTHPRIVATE_PAIR)

Powered by Google App Engine
This is Rietveld 408576698