From 75c86d739f763ca99c3437676806299589a1881c Mon Sep 17 00:00:00 2001 From: gasolin Date: Fri, 24 Jun 2016 13:02:08 +0100 Subject: [PATCH] Bug 1193006 - Show icons next to non-default permissions in the Permissions section of the Control Center. r=paolo MozReview-Commit-ID: 1YeU5ECOHYL --HG-- extra : rebase_source : 9f79b819312c1dda77daf2841e561a8bcc60b418 --- browser/base/content/browser.js | 5 ++++ .../test/general/browser_permissions.js | 4 ++++ .../controlcenter/content/panel.inc.xul | 3 ++- browser/modules/SitePermissions.jsm | 1 - .../themes/shared/controlcenter/panel.inc.css | 23 ++++++++++++++++--- browser/themes/shared/glyphs.svg | 1 + .../themes/shared/notification-icons.inc.css | 5 ++++ 7 files changed, 37 insertions(+), 5 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 8dca38b1c0d8..45a07cc3fc05 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -7242,8 +7242,13 @@ var gIdentityHandler = { label.setAttribute("control", menulist.getAttribute("id")); label.textContent = aPermission.label; + let img = document.createElement("image"); + img.setAttribute("class", + "identity-popup-permission-icon " + aPermission.id + "-icon"); + let container = document.createElement("hbox"); container.setAttribute("align", "center"); + container.appendChild(img); container.appendChild(label); container.appendChild(menulist); diff --git a/browser/base/content/test/general/browser_permissions.js b/browser/base/content/test/general/browser_permissions.js index 80b437ff6e01..0d5541fad343 100644 --- a/browser/base/content/test/general/browser_permissions.js +++ b/browser/base/content/test/general/browser_permissions.js @@ -45,6 +45,10 @@ add_task(function* testMainViewVisible() { is(menulists[0].value, "1", "Correct value on install menulist"); gIdentityHandler._identityPopup.hidden = true; + let img = menulists[0].parentNode.querySelector("image"); + ok(img, "There is an image for the permissions"); + ok(img.classList.contains("install-icon"), "proper class is in image class"); + gIdentityHandler.setPermission("install", SitePermissions.getDefault("install")); gIdentityHandler._identityBox.click(); diff --git a/browser/components/controlcenter/content/panel.inc.xul b/browser/components/controlcenter/content/panel.inc.xul index 15e82f240afd..f2e0e24ba152 100644 --- a/browser/components/controlcenter/content/panel.inc.xul +++ b/browser/components/controlcenter/content/panel.inc.xul @@ -87,7 +87,8 @@ -