Bug 814294 - Don't prompt for missing permissions (UNKNOWN_ACTION). r=sicking
authorGregor Wagner <gwagner@mozilla.com>
Tue, 27 Nov 2012 17:31:45 -0800
changeset 114314 448ae175d6b9035b13b6a0eb375c21be5b153b76
parent 114313 0c18c15c4985db3c4dd9c4492e3959f927c3e564
child 114315 a2744f8a62f4a1014ae27d5c1c3db61786c50ae2
push id23913
push useremorley@mozilla.com
push dateWed, 28 Nov 2012 17:11:31 +0000
treeherdermozilla-central@17c267a881cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs814294
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 814294 - Don't prompt for missing permissions (UNKNOWN_ACTION). r=sicking
b2g/components/ContentPermissionPrompt.js
--- a/b2g/components/ContentPermissionPrompt.js
+++ b/b2g/components/ContentPermissionPrompt.js
@@ -55,24 +55,26 @@ function rememberPermission(aPermission,
   }
 }
 
 function ContentPermissionPrompt() {}
 
 ContentPermissionPrompt.prototype = {
 
   handleExistingPermission: function handleExistingPermission(request) {
+    let promptForUnknown = ['geolocation'];
     let access = (request.access && request.access !== "unused") ? request.type + "-" + request.access :
                                                                    request.type;
     let result = Services.perms.testExactPermissionFromPrincipal(request.principal, access);
     if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
       request.allow();
       return true;
     }
-    if (result == Ci.nsIPermissionManager.DENY_ACTION) {
+    if (result == Ci.nsIPermissionManager.DENY_ACTION ||
+        result == Ci.nsIPermissionManager.UNKNOWN_ACTION && promptForUnknown.indexOf(access) < 0) {
       request.cancel();
       return true;
     }
     return false;
   },
 
   _id: 0,
   prompt: function(request) {