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

Side by Side Diff: content/test/data/android/geolocation.html

Issue 2446063002: Implement a modal permission dialog on Android gated by a feature. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Geolocation</title> 4 <title>Geolocation</title>
5 <script> 5 <script>
6 var positionCount = 0; 6 var positionCount = 0;
7
7 function gotPos(position) { 8 function gotPos(position) {
8 positionCount++; 9 positionCount++;
9 window.document.title = 'Count:' + positionCount; 10 window.document.title = 'Count:' + positionCount;
10 } 11 }
11 function errorCallback(error){ 12 function errorCallback(error){
12 window.document.title = 'deny'; 13 window.document.title = 'deny';
13 console.log('navigator.getCurrentPosition error: ', error); 14 console.log('navigator.getCurrentPosition error: ', error);
14 } 15 }
15 function initiate_getCurrentPosition() { 16 function initiate_getCurrentPosition() {
16 navigator.geolocation.getCurrentPosition( 17 navigator.geolocation.getCurrentPosition(
17 gotPos, errorCallback, { }); 18 gotPos, errorCallback, { });
18 } 19 }
19 function initiate_watchPosition() { 20 function initiate_watchPosition() {
20 navigator.geolocation.watchPosition( 21 navigator.geolocation.watchPosition(
21 gotPos, errorCallback, { }); 22 gotPos, errorCallback, { });
22 } 23 }
24
25 // The modal permission dialog requires a user gesture to trigger. H ook up
26 // a click event listener to run a specified method (which may be ch anged by
lshang 2016/11/01 03:47:44 wrap lines to 80-column limit
dominickn 2016/11/01 04:44:00 Done.
27 // the test).
28 var functionToRun = 'initiate_getCurrentPosition()';
29 function runFunctionOnClick() {
30 eval(functionToRun);
31 }
32
33 window.addEventListener('load', () => {
34 window.addEventListener('click', runFunctionOnClick);
35 });
23 </script> 36 </script>
24 </head> 37 </head>
25 <body> 38 <body>
26 </body> 39 </body>
27 </html> 40 </html>
OLDNEW
« chrome/browser/permissions/permission_queue_controller.cc ('K') | « chrome/common/chrome_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698