mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 775822 - Use the new Permission Manager API for B2G shell.js and CameraContent.js. r=vingtetun
This commit is contained in:
parent
4d8c0de9d5
commit
ca5f998306
@ -246,8 +246,8 @@ var shell = {
|
||||
if (!manifest)
|
||||
return;
|
||||
|
||||
let documentURI = contentWindow.document.documentURIObject;
|
||||
if (!Services.perms.testPermission(documentURI, 'offline-app')) {
|
||||
let principal = contentWindow.document.nodePrincipal;
|
||||
if (Services.perms.testPermissionFromPrincipal(principal, 'offline-app') == Ci.nsIPermissionManager.UNKNOWN_ACTION) {
|
||||
if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
|
||||
// FIXME Bug 710729 - Add a UI for offline cache notifications
|
||||
return;
|
||||
@ -255,8 +255,8 @@ var shell = {
|
||||
return;
|
||||
}
|
||||
|
||||
Services.perms.add(documentURI, 'offline-app',
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
Services.perms.addFromPrincipal(principal, 'offline-app',
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
|
||||
let manifestURI = Services.io.newURI(manifest, null, documentURI);
|
||||
let updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
|
||||
|
@ -59,7 +59,7 @@ CameraContent.prototype = {
|
||||
let principal = aWindow.document.nodePrincipal;
|
||||
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
|
||||
|
||||
let perm = principal == secMan.getSystemPrincipal() ? Ci.nsIPermissionManager.ALLOW_ACTION : Services.perms.testExactPermission(principal.URI, "content-camera");
|
||||
let perm = Services.perms.testExactPermissionFromPrincipal(principal, "content-camera");
|
||||
|
||||
//only pages with perm set and chrome pages can use the camera in content
|
||||
this.hasPrivileges = perm == Ci.nsIPermissionManager.ALLOW_ACTION;
|
||||
|
Loading…
Reference in New Issue
Block a user