summaryrefslogtreecommitdiffstats
path: root/extensions/common/api
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-11-09 19:25:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-10 03:27:01 +0000
commit1c6bf204d4ab0ad1536be848f2a5f33a454d35bf (patch)
tree51ecc396a61086dc8026c592e328315f57d820e3 /extensions/common/api
parent453bf5082bba44aba93b428387e0e112c4db0dd3 (diff)
downloadchromium_src-1c6bf204d4ab0ad1536be848f2a5f33a454d35bf.zip
chromium_src-1c6bf204d4ab0ad1536be848f2a5f33a454d35bf.tar.gz
chromium_src-1c6bf204d4ab0ad1536be848f2a5f33a454d35bf.tar.bz2
Add bluetoothPrivate.connect
Includes some formatting / cleanup of bluetooth_private_api.cc BUG=543294 For bluetooth_private.js generated externs TBR=dbeam@chromium.org Review URL: https://codereview.chromium.org/1419023004 Cr-Commit-Position: refs/heads/master@{#358780}
Diffstat (limited to 'extensions/common/api')
-rw-r--r--extensions/common/api/bluetooth_private.idl21
1 files changed, 21 insertions, 0 deletions
diff --git a/extensions/common/api/bluetooth_private.idl b/extensions/common/api/bluetooth_private.idl
index 7d7d244..0ef9bc2 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);
};