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

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 <p id="classSummary">
2 To create a location watch, call $ref:location.watchLocation passing in
3 the location watch details via the <code>requestInfo</code> parameter:
4 </p>
5
6 <pre>chrome.location.watchLocation(name, requestInfo);</pre>
7 <p>
8 You'll also need to add a listener
9 to its <code>onChanged</code> event.
10 Chrome will fire this event after you create your location watch. After this,
11 it will keep firing the event every time the geographical location of your
12 computer changes until you call $ref:location.clearWatch.
13 </p>
14 <p>
15 Here's sample code
16 to listen for location updates:
17 </p>
18 <pre>
19 chrome.location.onLocationUpdate.addListener(function(position) {
20 console.log(JSON.stringify(position));
21 });
22 </pre>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698