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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <h2 id="overview">Overview</h2>
2 <p>
3 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.
4 calling $ref:location.watchLocation, passing in
5 the location watch details via the <code>requestInfo</code> parameter:
6 </p>
7
8 <pre>chrome.location.watchLocation(name, requestInfo);</pre>
9 <p>
10 You also need to add a listener
11 to $ref:location.onLocationUpdate event.
Andy 2013/07/30 20:26:14 "to" --> "for the"
vadimt 2013/08/01 00:02:02 Done.
12 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.
13 it will keep firing the event every time the geographic
14 location of the host machine changes, until you call $ref:location.clearWatch.
15 </p>
16 <p>
17 Here's sample code
18 to listen for location updates:
19 </p>
20 <pre>
21 chrome.location.onLocationUpdate.addListener(function(position) {
22 console.log(JSON.stringify(position));
23 });
24 </pre>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698