From ad5b1fde34281e91e85d355a9dc5178797977aa9 Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Sat, 13 Mar 2021 16:06:33 +0000 Subject: [PATCH] Bug 1698237 - Backed out changeset 18909220355a (bug 1697806). Differential Revision: https://phabricator.services.mozilla.com/D108316 --- browser/base/content/test/webextensions/head.js | 8 +++++++- browser/components/extensions/extension.svg | 19 +++++++++++++++++++ browser/components/extensions/jar.mn | 1 + .../test/browser/browser_ext_browserAction_context.js | 2 +- .../browser_ext_browserAction_pageAction_icon.js | 2 +- .../test/browser/browser_ext_pageAction_context.js | 2 +- .../test/browser/browser_ext_sidebarAction_context.js | 2 +- browser/components/urlbar/UrlbarUtils.jsm | 2 +- browser/themes/shared/notification-icons.inc.css | 2 +- toolkit/components/extensions/ExtensionParent.jsm | 4 ++-- 10 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 browser/components/extensions/extension.svg diff --git a/browser/base/content/test/webextensions/head.js b/browser/base/content/test/webextensions/head.js index 161ee26424c3..578e069e59ce 100644 --- a/browser/base/content/test/webextensions/head.js +++ b/browser/base/content/test/webextensions/head.js @@ -182,7 +182,13 @@ function triggerPageOptionsAction(win, action) { } function isDefaultIcon(icon) { - return icon == "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + // These are basically the same icon, but code within webextensions + // generates references to the former and generic add-ons manager code + // generates referces to the latter. + return ( + icon == "chrome://browser/content/extension.svg" || + icon == "chrome://mozapps/skin/extensions/extensionGeneric.svg" + ); } /** diff --git a/browser/components/extensions/extension.svg b/browser/components/extensions/extension.svg new file mode 100644 index 000000000000..a16455253834 --- /dev/null +++ b/browser/components/extensions/extension.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/browser/components/extensions/jar.mn b/browser/components/extensions/jar.mn index 2846e7d17594..5cc04e18fe4c 100644 --- a/browser/components/extensions/jar.mn +++ b/browser/components/extensions/jar.mn @@ -11,6 +11,7 @@ browser.jar: #ifdef XP_WIN content/browser/extension-win-panel.css #endif + content/browser/extension.svg content/browser/ext-browser.json content/browser/parent/ext-bookmarks.js (parent/ext-bookmarks.js) content/browser/parent/ext-browser.js (parent/ext-browser.js) diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_context.js b/browser/components/extensions/test/browser/browser_ext_browserAction_context.js index 5549150f42d0..d7463f8be98b 100644 --- a/browser/components/extensions/test/browser/browser_ext_browserAction_context.js +++ b/browser/components/extensions/test/browser/browser_ext_browserAction_context.js @@ -563,7 +563,7 @@ add_task(async function testPropertyRemoval() { }, getTests: function(tabs, windows) { - let defaultIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + let defaultIcon = "chrome://browser/content/extension.svg"; let details = [ { icon: browser.runtime.getURL("default.png"), diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js index 5c4c5725382c..1051e5f3642e 100644 --- a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js +++ b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js @@ -365,7 +365,7 @@ add_task(async function testDetailsObjects() { await promiseAnimationFrame(); // The initial icon should be the default icon since no icon is in the manifest. - const DEFAULT_ICON = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + const DEFAULT_ICON = "chrome://browser/content/extension.svg"; let browserActionButton = browserActionWidget.forWindow(window).node; let pageActionImage = document.getElementById(pageActionId); is( diff --git a/browser/components/extensions/test/browser/browser_ext_pageAction_context.js b/browser/components/extensions/test/browser/browser_ext_pageAction_context.js index 660ca7131cb0..558b6de81eed 100644 --- a/browser/components/extensions/test/browser/browser_ext_pageAction_context.js +++ b/browser/components/extensions/test/browser/browser_ext_pageAction_context.js @@ -51,7 +51,7 @@ add_task(async function testTabSwitchContext() { }, getTests: function(tabs) { - let defaultIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + let defaultIcon = "chrome://browser/content/extension.svg"; let details = [ { icon: browser.runtime.getURL("default.png"), diff --git a/browser/components/extensions/test/browser/browser_ext_sidebarAction_context.js b/browser/components/extensions/test/browser/browser_ext_sidebarAction_context.js index aade93a3c727..37b673783a5d 100644 --- a/browser/components/extensions/test/browser/browser_ext_sidebarAction_context.js +++ b/browser/components/extensions/test/browser/browser_ext_sidebarAction_context.js @@ -431,7 +431,7 @@ add_task(async function testPropertyRemoval() { }, getTests: function(tabs, windows) { - let defaultIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + let defaultIcon = "chrome://browser/content/extension.svg"; let details = [ { icon: browser.runtime.getURL("default.png"), diff --git a/browser/components/urlbar/UrlbarUtils.jsm b/browser/components/urlbar/UrlbarUtils.jsm index 169800933ae9..26d4133f4f42 100644 --- a/browser/components/urlbar/UrlbarUtils.jsm +++ b/browser/components/urlbar/UrlbarUtils.jsm @@ -147,7 +147,7 @@ var UrlbarUtils = { // This defines icon locations that are commonly used in the UI. ICON: { // DEFAULT is defined lazily so it doesn't eagerly initialize PlacesUtils. - EXTENSION: "chrome://mozapps/skin/extensions/extensionGeneric.svg", + EXTENSION: "chrome://browser/content/extension.svg", HISTORY: "chrome://browser/skin/history.svg", SEARCH_GLASS: "chrome://global/skin/icons/search-glass.svg", SEARCH_GLASS_INVERTED: "chrome://browser/skin/search-glass-inverted.svg", diff --git a/browser/themes/shared/notification-icons.inc.css b/browser/themes/shared/notification-icons.inc.css index 9c18daeeff00..d11c6da138a6 100644 --- a/browser/themes/shared/notification-icons.inc.css +++ b/browser/themes/shared/notification-icons.inc.css @@ -299,7 +299,7 @@ html|*#webRTC-previewVideo { } .popup-notification-icon[popupid="addon-install-confirmation"] { - list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.svg); + list-style-image: url(chrome://browser/content/extension.svg); } #addon-install-confirmation-notification[warning] .popup-notification-icon[popupid="addon-install-confirmation"] { diff --git a/toolkit/components/extensions/ExtensionParent.jsm b/toolkit/components/extensions/ExtensionParent.jsm index e99eba29c512..496a9d80e973 100644 --- a/toolkit/components/extensions/ExtensionParent.jsm +++ b/toolkit/components/extensions/ExtensionParent.jsm @@ -1555,7 +1555,7 @@ function watchExtensionProxyContextLoad( // Manages icon details for toolbar buttons in the |pageAction| and // |browserAction| APIs. let IconDetails = { - DEFAULT_ICON: "chrome://mozapps/skin/extensions/extensionGeneric.svg", + DEFAULT_ICON: "chrome://browser/content/extension.svg", // WeakMap Map Map object>>> iconCache: new DefaultWeakMap(() => { @@ -1675,7 +1675,7 @@ let IconDetails = { // Returns the appropriate icon URL for the given icons object and the // screen resolution of the given window. getPreferredIcon(icons, extension = null, size = 16) { - const DEFAULT = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; + const DEFAULT = "chrome://browser/content/extension.svg"; let bestSize = null; if (icons[size]) { -- 2.11.4.GIT