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

Unified Diff: extensions/common/api/bluetooth_private.idl

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/common/api/bluetooth_private.idl
diff --git a/extensions/common/api/bluetooth_private.idl b/extensions/common/api/bluetooth_private.idl
index 7d7d2448ffbde60c654434878cd0eabaf929934d..0ef9bc2ac362ee19e02c167def88841eb83377a2 100644
--- a/extensions/common/api/bluetooth_private.idl
+++ b/extensions/common/api/bluetooth_private.idl
@@ -43,6 +43,20 @@ namespace bluetoothPrivate {
complete
};
+ // Results for connect(). See function declaration for details.
+ enum ConnectResultType {
+ success,
+ unknownError,
+ inProgress,
+ alreadyConnected,
+ failed,
+ authFailed,
+ authCanceled,
+ authRejected,
+ authTimeout,
+ unsupportedDevice
+ };
+
// Valid pairing responses.
enum PairingResponse {
confirm, reject, cancel
@@ -105,6 +119,7 @@ namespace bluetoothPrivate {
};
callback VoidCallback = void();
+ callback ConnectCallback = void(ConnectResultType result);
// These functions all report failures via chrome.runtime.lastError.
interface Functions {
@@ -124,6 +139,12 @@ namespace bluetoothPrivate {
static void setDiscoveryFilter(DiscoveryFilter discoveryFilter,
optional VoidCallback callback);
+ // Connects to the given device. This will only throw an error if the
+ // device address is invalid or the device is already connected. Otherwise
+ // this will succeed and invoke |callback| with ConnectResultType.
+ static void connect(DOMString deviceAddress,
+ optional ConnectCallback callback);
+
// Pairs the given device.
static void pair(DOMString deviceAddress, optional VoidCallback callback);
};
« no previous file with comments | « extensions/browser/extension_function_histogram_value.h ('k') | third_party/closure_compiler/externs/bluetooth_private.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698