Bug 1519434 - remove permissions popup and page info code catering to flash permissions, r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D34218

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-06-13 08:42:53 +00:00
parent 3db5095b08
commit 72464081e3
7 changed files with 3 additions and 36 deletions

View File

@ -1081,12 +1081,7 @@ var gIdentityHandler = {
container.setAttribute("role", "group");
let img = document.createXULElement("image");
img.classList.add("identity-popup-permission-icon");
if (aPermission.id == "plugin:flash") {
img.classList.add("plugin-icon");
} else {
img.classList.add(aPermission.id + "-icon");
}
img.classList.add("identity-popup-permission-icon", aPermission.id + "-icon");
if (aPermission.state == SitePermissions.BLOCK)
img.classList.add("blocked-permission-icon");

View File

@ -885,8 +885,6 @@
tooltiptext="&urlbar.autoplayMediaBlocked.tooltip;"/>
<image data-permission-id="canvas" class="blocked-permission-icon canvas-icon" role="button"
tooltiptext="&urlbar.canvasBlocked.tooltip;"/>
<image data-permission-id="plugin:flash" class="blocked-permission-icon plugin-icon" role="button"
tooltiptext="&urlbar.flashPluginBlocked.tooltip;"/>
<image data-permission-id="midi" class="blocked-permission-icon midi-icon" role="button"
tooltiptext="&urlbar.midiBlocked.tooltip;"/>
<image data-permission-id="install" class="blocked-permission-icon install-icon" role="button"

View File

@ -85,11 +85,6 @@ function initRow(aPartId) {
return;
}
// When flash permission state is "Hide", we show it as "Always Ask" in page info.
if (aPartId.startsWith("plugin") && state == SitePermissions.PROMPT_HIDE) {
defaultState == SitePermissions.UNKNOWN ? state = defaultState : state = SitePermissions.PROMPT;
}
if (state != defaultState) {
checkbox.checked = false;
command.removeAttribute("disabled");

View File

@ -46,6 +46,5 @@ permission.shortcuts.label = Override Keyboard Shortcuts
permission.focus-tab-by-prompt.label = Switch to this Tab
permission.persistent-storage.label = Store Data in Persistent Storage
permission.canvas.label = Extract Canvas Data
permission.flash-plugin.label = Run Adobe Flash
permission.midi.label = Access MIDI Devices
permission.midi-sysex.label = Access MIDI Devices with SysEx Support

View File

@ -238,14 +238,11 @@ const GloballyBlockedPermissions = {
*/
var SitePermissions = {
// Permission states.
// PROMPT_HIDE state is only used to show the "Hide Prompt" state in the identity panel
// for the "plugin:flash" permission and not in pageinfo.
UNKNOWN: Services.perms.UNKNOWN_ACTION,
ALLOW: Services.perms.ALLOW_ACTION,
BLOCK: Services.perms.DENY_ACTION,
PROMPT: Services.perms.PROMPT_ACTION,
ALLOW_COOKIES_FOR_SESSION: Ci.nsICookiePermission.ACCESS_SESSION,
PROMPT_HIDE: Ci.nsIObjectLoadingContent.PLUGIN_PERMISSION_PROMPT_ACTION_QUIET,
AUTOPLAY_BLOCKED_ALL: Ci.nsIAutoplay.BLOCKED_ALL,
// Permission scopes.
@ -825,12 +822,6 @@ var SitePermissions = {
* unknown state was passed.
*/
getCurrentStateLabel(state, id, scope = null) {
// We try to avoid a collision between SitePermissions.PROMPT_HIDE
// and SitePermissions.ALLOW_COOKIES_FOR_SESSION which share the same const value.
if (id.startsWith("plugin") && state == SitePermissions.PROMPT_HIDE) {
return gStringBundle.GetStringFromName("state.current.hide");
}
switch (state) {
case this.PROMPT:
return gStringBundle.GetStringFromName("state.current.prompt");
@ -873,8 +864,6 @@ var gPermissionObject = {
* - states
* Array of permission states to be exposed to the user.
* Defaults to ALLOW, BLOCK and the default state (see getDefault).
* The PROMPT_HIDE state is deliberately excluded from "plugin:flash" since we
* don't want to expose a "Hide Prompt" button to the user through pageinfo.
*/
"autoplay-media": {
@ -987,11 +976,6 @@ var gPermissionObject = {
"canvas": {
},
"plugin:flash": {
labelID: "flash-plugin",
states: [ SitePermissions.UNKNOWN, SitePermissions.ALLOW, SitePermissions.BLOCK ],
},
"midi": {
exactHostMatch: true,
},

View File

@ -30,7 +30,7 @@ add_task(async function testNsIURI() {
add_task(async function testPermissionsListing() {
let expectedPermissions = ["autoplay-media", "camera", "cookie", "desktop-notification", "focus-tab-by-prompt",
"geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts",
"geo", "image", "install", "microphone", "popup", "screen", "shortcuts",
"persistent-storage", "storage-access"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
@ -133,7 +133,7 @@ add_task(async function testExactHostMatch() {
exactHostMatched.push("midi");
exactHostMatched.push("midi-sysex");
}
let nonExactHostMatched = ["image", "cookie", "plugin:flash", "popup", "install", "shortcuts",
let nonExactHostMatched = ["image", "cookie", "popup", "install", "shortcuts",
"storage-access"];
let permissions = SitePermissions.listPermissions();

View File

@ -291,10 +291,6 @@ html|*#webRTC-previewVideo {
transition: fill 1.5s;
}
.plugin-icon.blocked-permission-icon {
list-style-image: url(chrome://global/skin/plugins/plugin-blocked.svg);
}
#plugin-icon-badge {
list-style-image: url(chrome://browser/skin/notification-icons/plugin-badge.svg);
opacity: 0;