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

Unified Diff: chrome/common/extensions/api/experimental_bluetooth.idl

Issue 10536159: Bluetooth Extension API: Add a discovery API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reland Created 8 years, 6 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 | « chrome/chrome_browser_extensions.gypi ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/experimental_bluetooth.idl
diff --git a/chrome/common/extensions/api/experimental_bluetooth.idl b/chrome/common/extensions/api/experimental_bluetooth.idl
index 34dffe7d4a1f2c696d4b53df6dc3f0e5e9e29f75..5ef65b8a9fc24f3071d340f596ee7a2e46e70ab1 100644
--- a/chrome/common/extensions/api/experimental_bluetooth.idl
+++ b/chrome/common/extensions/api/experimental_bluetooth.idl
@@ -44,6 +44,7 @@
callback AddressCallback = void (DOMString result);
callback BooleanCallback = void (boolean result);
callback DataCallback = void (ArrayBuffer result);
+ callback DeviceCallback = void (Device device);
callback DevicesCallback = void (Device[] result);
callback OutOfBandPairingDataCallback = void (OutOfBandPairingData data);
callback ResultCallback = void ();
@@ -104,6 +105,12 @@
OutOfBandPairingData? data;
};
+ // Options for the startDiscovery function.
+ dictionary StartDiscoveryOptions {
+ // Called for each device that is discovered.
+ DeviceCallback deviceCallback;
+ };
+
// These functions all report failures via chrome.extension.lastError.
interface Functions {
// Checks if the system has bluetooth support.
@@ -160,6 +167,20 @@
// |callback| : Called to indicate success or failure.
static void setOutOfBandPairingData(SetOutOfBandPairingDataOptions options,
optional ResultCallback callback);
+
+ // Start discovery. Discovered devices will be returned via the
+ // |onDeviceDiscovered| callback. Note that discovery can be resource
+ // intensive. stopDiscovery should be called as soon as is convenient.
+ // |options| : The options for this function.
+ // |callback| : Called to indicate success or failure.
+ static void startDiscovery(
+ StartDiscoveryOptions options,
+ optional ResultCallback callback);
+
+ // Stop discovery.
+ // |callback| : Called to indicate success or failure.
+ static void stopDiscovery(
+ optional ResultCallback callback);
};
interface Events {
@@ -170,5 +191,9 @@
// Fired when the power state of bluetooth on the system changes.
// |powered| : True if bluetooth is powered, false otherwise.
static void onPowerChanged(boolean has_power);
+
+ // Used to return discovered devices to the extension. Users should not
+ // add listeners to this event directly.
+ static void onDeviceDiscovered_(Device device);
};
};
« no previous file with comments | « chrome/chrome_browser_extensions.gypi ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698