Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / chrome / test / data / geolocation / simple.html
blob3e91c2276223fe4b02eb062dc6751373f7ae1089
1 <html>
2 <head>
3 <script>
4 var last_position = 0;
5 var last_error = 0;
6 var watch_id = 0;
7 var navigation_count = 0;
8 var max_navigation_count = undefined;
9 var iteration = 0;
10 function geoNavigateIfNeeded(msg) {
11 if (max_navigation_count == undefined ||
12 navigation_count++ < max_navigation_count) {
13 ++iteration;
14 document.location.hash = '#' + iteration + ':' + msg;
17 function geoSuccessCallback(position) {
18 last_position = position;
19 geoNavigateIfNeeded('geoSuccessCallback');
21 function geoErrorCallback(error) {
22 last_error = error;
23 geoNavigateIfNeeded('geoErrorCallback');
25 function geoStart() {
26 watch_id = navigator.geolocation.watchPosition(
27 geoSuccessCallback, geoErrorCallback,
28 {maximumAge:600000, timeout:100000, enableHighAccuracy:true});
29 return watch_id;
31 function geoGetLastPositionLatitude() {
32 return "" + last_position.coords.latitude;
34 function geoGetLastPositionLongitude() {
35 return "" + last_position.coords.longitude;
37 function geoGetLastError() {
38 return "" + (last_error ? last_error.code : 0);
40 function geoSetMaxNavigateCount(max_navigations) {
41 navigation_count = 0;
42 max_navigation_count = max_navigations;
43 return "" + max_navigation_count;
45 function geoAccessNavigatorGeolocation() {
46 return "" + typeof(navigator.geolocation);
48 </script>
49 </head>
50 <body>
51 <input type="button" value="manual" onclick="geoStart()"/>
52 </body>
53 </html>