mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1513681 - part4 : remove the logic about setting globally blocked in PermissionUI. r=daleharvey
We've handle showing the blocking icon in patch2, so we don't need to set block permission in PermissionUI. Differential Revision: https://phabricator.services.mozilla.com/D14797 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d861885915
commit
048a1e2282
@ -306,19 +306,6 @@ var PermissionPromptPrototype = {
|
||||
this.browser);
|
||||
|
||||
if (state == SitePermissions.BLOCK) {
|
||||
// If the request is blocked by a global setting then we record
|
||||
// a flag that lasts for the duration of the current page load
|
||||
// to notify the user that the permission has been blocked.
|
||||
// Currently only applies to autoplay-media
|
||||
if (state == SitePermissions.getDefault(this.permissionKey) &&
|
||||
SitePermissions.showGloballyBlocked(this.permissionKey)) {
|
||||
SitePermissions.set(this.principal.URI,
|
||||
this.permissionKey,
|
||||
state,
|
||||
SitePermissions.SCOPE_GLOBAL,
|
||||
this.browser);
|
||||
}
|
||||
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
@ -340,8 +327,6 @@ var PermissionPromptPrototype = {
|
||||
this.browser);
|
||||
|
||||
if (state == SitePermissions.BLOCK) {
|
||||
// TODO: Add support for showGloballyBlocked
|
||||
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
|
@ -434,23 +434,6 @@ var SitePermissions = {
|
||||
return this._defaultPrefBranch.getIntPref(permissionID, this.UNKNOWN);
|
||||
},
|
||||
|
||||
/**
|
||||
* Return whether the browser should notify the user if a permission was
|
||||
* globally blocked due to a preference.
|
||||
*
|
||||
* @param {string} permissionID
|
||||
* The ID to get the state for.
|
||||
*
|
||||
* @return boolean Whether to show notification for globally blocked permissions.
|
||||
*/
|
||||
showGloballyBlocked(permissionID) {
|
||||
if (permissionID in gPermissionObject &&
|
||||
gPermissionObject[permissionID].showGloballyBlocked)
|
||||
return gPermissionObject[permissionID].showGloballyBlocked;
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/*
|
||||
* Return whether SitePermissions is permitted to store a TEMPORARY ALLOW
|
||||
* state for a particular permission.
|
||||
@ -763,7 +746,6 @@ var gPermissionObject = {
|
||||
|
||||
"autoplay-media": {
|
||||
exactHostMatch: true,
|
||||
showGloballyBlocked: true,
|
||||
permitTemporaryAllow: true,
|
||||
notifyWhenTemporaryPermissionChanged: true,
|
||||
getDefault() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user