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

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: 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..0e995327cefd2e998cc714f4e3ff48cef8b09c28
--- /dev/null
+++ b/chrome/common/extensions/docs/templates/intros/location.html
@@ -0,0 +1,24 @@
+<h2 id="overview">Overview</h2>
+<p>
+ To start retrieving the location, you need to create a location watch by
Andy 2013/07/30 20:26:14 "the location" --> "location information"
vadimt 2013/08/01 00:02:02 Done.
+ 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
+ to $ref:location.onLocationUpdate event.
Andy 2013/07/30 20:26:14 "to" --> "for the"
vadimt 2013/08/01 00:02:02 Done.
+ Chrome will fire this event after you create your location watch. After this,
Andy 2013/07/30 20:26:14 It's not clear what "this" refers to in "After thi
vadimt 2013/08/01 00:02:02 Done.
+ 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>

Powered by Google App Engine
This is Rietveld 408576698