From 048a1e228238d7d1d321f525aeeae9802701eb7d Mon Sep 17 00:00:00 2001 From: Alastor Wu Date: Fri, 4 Jan 2019 18:36:20 +0000 Subject: [PATCH] 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 --- browser/modules/PermissionUI.jsm | 15 --------------- browser/modules/SitePermissions.jsm | 18 ------------------ 2 files changed, 33 deletions(-) diff --git a/browser/modules/PermissionUI.jsm b/browser/modules/PermissionUI.jsm index 21c09b3363bf..ff77f82a1ba3 100644 --- a/browser/modules/PermissionUI.jsm +++ b/browser/modules/PermissionUI.jsm @@ -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; } diff --git a/browser/modules/SitePermissions.jsm b/browser/modules/SitePermissions.jsm index 3e72127843c6..582566001dba 100644 --- a/browser/modules/SitePermissions.jsm +++ b/browser/modules/SitePermissions.jsm @@ -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() {