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

Unified Diff: chrome/common/extensions/docs/templates/intros/dial.html

Issue 16876004: Updating JSON Schema Compiler to add description field to schemas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial codereview changes Created 7 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
Index: chrome/common/extensions/docs/templates/intros/dial.html
diff --git a/chrome/common/extensions/docs/templates/intros/dial.html b/chrome/common/extensions/docs/templates/intros/dial.html
new file mode 100644
index 0000000000000000000000000000000000000000..9d84882f83911337d7a18737af9e4c1f8968cb38
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/intros/dial.html
@@ -0,0 +1,30 @@
+<p>The <code>chrome.dial</code> 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.)
+</p>
+
+<p>The onDeviceList event is fired when discovery respnses are received and in
+other circumstances; see the documentation for onDeviceList.</p>
+
+<p>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.</p>
+
+<p>On-demand use (updates when discoverNow() is called):
+<pre>
+chrome.dial.onDeviceList.addListener(function (list) { updateMenu(list); });
+chrome.dial.discoverNow();
+</pre>
+(Remember to remove the listener when the menu closes.)</p>
+
+<p>Background use (updates only when periodic polling happens):</p>
+
+<pre>
+var myList;
+chrome.dial.onDeviceList.addListener(function (list) { myList = list; });
+</pre>
+
+<p>These can be combined to poll for devices to prime the device menu, then
+refresh the menu when it is displayed.</p>
epeterson 2013/06/20 23:07:40 Here's the chrome.dial intro. I added a public tem

Powered by Google App Engine
This is Rietveld 408576698