Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / test / data / geolocation / geolocation_on_load.html
blob69b0bb54a1d1a7ec43f3b0e58f786af0f2995586
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
5 <title>Show Geolocation on page load</title>
6 <script>
8 function triggerGeo(onSuccess, onError) {
9 if (navigator.geolocation) {
10 navigator.geolocation.getCurrentPosition(onSuccess, onError);
11 } else {
12 document.getElementById('lat').innerHTML =
13 'Error: navigator.geolocation is false';
14 document.getElementById('lng').innerHTML = '';
19 function triggerGeoWithCallback(callback){
20 triggerGeo(function (position){
21 callback("allow");
22 }, function(positionError){
23 callback("block");
24 });
27 function showPosition(position) {
28 var lat = position.coords.latitude;
29 var lng = position.coords.longitude;
30 document.getElementById('lat').innerHTML = lat;
31 document.getElementById('lng').innerHTML = lng;
34 function showError(positionError) {
35 document.getElementById('lat').innerHTML =
36 positionError.message;
37 document.getElementById('lng').innerHTML = '';
40 </script>
41 </head>
43 <body onload="triggerGeo(showPosition, showError)">
44 <b id=lat>-1</b>, <b id=lng>-1</b>
45 </body>
47 </html>