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

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

Issue 19763008: Adding dev documentation for chrome.location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final comments. Created 7 years, 5 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/location.html
diff --git a/chrome/common/extensions/docs/templates/intros/location.html b/chrome/common/extensions/docs/templates/intros/location.html
new file mode 100644
index 0000000000000000000000000000000000000000..2e2396120ebcbb3c688a447a56d865df7ab48c55
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/intros/location.html
@@ -0,0 +1,24 @@
+<h2 id="overview">Overview</h2>
+<p>
+ To start retrieving location information, you need to create a location watch
+ by calling $ref:location.watchLocation, passing in
+ the location watch details via the <code>requestInfo</code> parameter:
+</p>
+
+<pre>chrome.location.watchLocation(name, requestInfo);</pre>
+<p>
+ You also need to add a listener
+ for the $ref:location.onLocationUpdate event.
+ Chrome will fire this event after you create your location watch, and
+ it will keep firing the event every time the geographic
+ location of the host machine changes, until you call $ref:location.clearWatch.
+</p>
+<p>
+ Here's sample code
+ to listen for location updates:
+</p>
+<pre>
+ chrome.location.onLocationUpdate.addListener(function(position) {
+ console.log(JSON.stringify(position));
+ });
+</pre>
« no previous file with comments | « chrome/common/extensions/api/location.idl ('k') | chrome/common/extensions/docs/templates/public/apps/location.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698