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

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

Issue 11444020: DIAL extension API skeleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: abc.... Created 8 years 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/common/extensions/api/api.gyp ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/dial.idl
diff --git a/chrome/common/extensions/api/dial.idl b/chrome/common/extensions/api/dial.idl
new file mode 100644
index 0000000000000000000000000000000000000000..7730c7143ed24d9d3b6e013edb5d50e6c5fda252
--- /dev/null
+++ b/chrome/common/extensions/api/dial.idl
@@ -0,0 +1,71 @@
+// Copyright (c) 2012 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.
+
+// An API for discovery of devices that support DIAL.
+// Protocol specification: http://www.dial-multiscreen.org/
+//
+// The API is backed by a service that multicasts discovery requests on the
+// local network to discover DIAL-capable devices and maintains a list of
+// devices that have responded. Adding an onDeviceList listener causes the
+// service to periodically issue discovery requests to maintain the device list.
+// (No polling is done when there are no onDeviceList listeners.)
+//
+// The onDeviceList event is fired when discovery respnses are received and in
+// other circumstances (see docs).
+//
+// The client can request that network discovery can be done immediately by
+// invoking discoverNow() which is useful for presenting the user with an
+// updated list of devices.
+//
+// On-demand use (updates when discoverNow() is called):
+// chrome.dial.onDeviceList.addListener(function (list) { updateMenu(list); });
+// chrome.dial.discoverNow();
+// (Remember to remove the listener when the menu closes.)
+//
+// Background use (updates only when periodic polling happens):
+// var myList;
+// chrome.dial.onDeviceList.addListener(function (list) { myList = list; });
+//
+// These can be combined to poll for devices to prime the device menu, then
+// refresh the menu when it is displayed.
+
+namespace dial {
+
+ // Represents a unique device that responded to a DIAL discovery request.
+ dictionary DialDevice {
+ // A label identifying the device within this instance of the browser.
+ // Not guaranteed to persist beyond browser instances.
+ DOMString deviceLabel;
+
+ // A URL pointing to the device description file for the device.
+ DOMString deviceDescriptionUrl;
+
+ // The uPnP configuration ID reported by the device. Corresponds to the
+ // CONFIGID.UPNP.ORG header in the M-SEARCH response.
+ long? configId;
+ };
+
+ callback BooleanCallback = void (boolean result);
+
+ interface Functions {
+ // Causes DIAL discovery to happen immediately. An onDeviceList event is
+ // fired with the resulting device list. The callback is invoked with
+ // |true| if discovery was successful or |false| otherwise (and
+ // chrome.extension.lastError is set).
+ static void discoverNow(BooleanCallback callback);
+ };
+
+ interface Events {
+ // Event fired to inform clients of the current set of responsive devices.
+ // May be fired in response to multiple circumstances:
+ //
+ // (1) The DIAL service refreshed its device list through periodic polling.
+ // (2) A client invoked discoverNow().
+ // (3) An event happened that should invalidate the device list
+ // (e.g., a network interface went offline), in which case it is fired
+ // with an empty array.
+ static void onDeviceList(DialDevice[] result);
+ };
+
+};
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698