Bug 1495708 - Remove theme info bar and update plugin notice r=aswan,jaws
authorMark Striemer <mstriemer@mozilla.com>
Wed, 17 Oct 2018 18:15:24 +0000
changeset 490114 1e14b8c79bb391afca2e4854eca8a051b5cb5d5d
parent 490113 bbff80c1200f8031eb67e785a87f79dc5c71c2b9
child 490115 51dbe7eb45c61137883155104110ee3d6588338f
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersaswan, jaws
bugs1495708
milestone64.0a1
Bug 1495708 - Remove theme info bar and update plugin notice r=aswan,jaws Differential Revision: https://phabricator.services.mozilla.com/D8105
browser/app/profile/firefox.js
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
toolkit/mozapps/extensions/content/extensions.css
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/mozapps/extensions/test/browser/browser.ini
toolkit/mozapps/extensions/test/browser/browser_getmorethemes.js
toolkit/themes/shared/in-content/common.inc.css
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -38,17 +38,16 @@ pref("extensions.webextOptionalPermissio
 
 // Preferences for AMO integration
 pref("extensions.getAddons.cache.enabled", true);
 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v3/addons/search/?guid=%IDS%&lang=%LOCALE%");
 pref("extensions.getAddons.compatOverides.url", "https://services.addons.mozilla.org/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
 pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
 pref("extensions.webservice.discoverURL", "https://discovery.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%/%COMPATIBILITY_MODE%");
 pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/");
-pref("extensions.getAddons.themes.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/themes/?src=firefox");
 pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v3/addons/language-tools/?app=firefox&type=language&appversion=%VERSION%");
 
 pref("extensions.update.autoUpdateDefault", true);
 
 // Check AUS for system add-on updates.
 pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
 pref("extensions.systemAddon.update.enabled", true);
 
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -14,19 +14,16 @@
 <!ENTITY listEmpty.availableUpdates.label     "No updates found">
 <!ENTITY listEmpty.recentUpdates.label        "You haven’t recently updated any add-ons">
 <!ENTITY listEmpty.findUpdates.label          "Check For Updates">
 <!ENTITY listEmpty.button.label               "Learn more about add-ons">
 <!ENTITY installAddonFromFile.label           "Install Add-on From File…">
 <!ENTITY installAddonFromFile.accesskey       "I">
 <!ENTITY toolsMenu.tooltip                    "Tools for all add-ons">
 
-<!ENTITY getThemes.description                "Looking to personalize your browser?">
-<!ENTITY getThemes.learnMore                  "Choose from thousands of themes.">
-
 
 <!ENTITY showUnsignedExtensions.button.label  "Some extensions could not be verified">
 <!ENTITY showAllExtensions.button.label       "Show all extensions">
 <!ENTITY debugAddons.label                    "Debug Add-ons">
 <!ENTITY debugAddons.accesskey                "B">
 
 <!-- global warnings -->
 <!ENTITY warning.safemode.label                    "All add-ons have been disabled by safe mode.">
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -135,22 +135,28 @@ row[unsupported="true"] {
 }
 
 /* Plugins aren't yet disabled by safemode (bug 342333),
    so don't show that warning when viewing plugins. */
 #addons-page[warning="safemode"] .view-pane[type="plugin"] .global-warning-container,
 #addons-page[warning="safemode"] #detail-view[loading="true"] .global-warning {
   display: none;
 }
-
-#addons-page .view-pane:not([type="theme"]) #getthemes-container,
 #addons-page .view-pane:not([type="plugin"]) #plugindeprecation-notice {
   display: none;
 }
 
+.list-view-notice {
+  margin-inline-start: 32px;
+}
+
+.list-view-notice > .message-bar {
+  width: 664px;
+}
+
 .addon .relnotes {
   -moz-user-select: text;
 }
 #detail-name, #detail-desc, #detail-fulldesc {
   -moz-user-select: text;
 }
 
 /* Make sure we're not animating hidden images. See bug 623739. */
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2364,23 +2364,16 @@ var gListView = {
     }
 
     if (Preferences.get("plugin.load_flash_only", true)) {
       document.getElementById("plugindeprecation-learnmore-link")
         .setAttribute("href", SUPPORT_URL + "npapi");
     } else {
       document.getElementById("plugindeprecation-notice").hidden = true;
     }
-
-    if (Preferences.get("extensions.getAddons.themes.browseURL", "")) {
-      document.getElementById("getthemes-learnmore-link")
-        .setAttribute("href", Services.urlFormatter.formatURLPref("extensions.getAddons.themes.browseURL"));
-    } else {
-      document.getElementById("getthemes-container").hidden = true;
-    }
   },
 
   show(aType, aRequest) {
     let showOnlyDisabledUnsigned = false;
     if (aType.endsWith("?unsigned=true")) {
       aType = aType.replace(/\?.*/, "");
       showOnlyDisabledUnsigned = true;
     }
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -203,16 +203,17 @@
                   <description class="discover-description">&discover.description2;</description>
                   <description class="discover-footer">&discover.footer;</description>
                 </vbox>
               </vbox>
               <spacer class="discover-spacer-after"/>
             </hbox>
             <spacer class="alert-spacer-after"/>
           </vbox>
+
           <browser id="discover-browser" type="content" flex="1"
                    disablehistory="true"/>
         </deck>
 
         <!-- container for views with the search/tools header -->
         <vbox id="headered-views" flex="1">
           <!-- main header -->
           <hbox id="header">
@@ -309,29 +310,24 @@
               </vbox>
               <vbox id="legacy-extensions-notice" class="alert-container" hidden="true">
                 <vbox class="alert">
                   <description id="legacy-extensions-description">
                     <label class="text-link plain" id="legacy-extensions-learnmore-link">&legacyWarning.showLegacy;</label>
                   </description>
                 </vbox>
               </vbox>
-              <vbox id="plugindeprecation-notice" class="alert-container">
-                <vbox class="alert">
-                  <description>&pluginDeprecation.description; &#160;
+              <vbox id="plugindeprecation-notice" class="list-view-notice" align="start">
+                <hbox class="message-bar">
+                  <image class="message-bar-icon"/>
+                  <description class="message-bar-description">
+                    &pluginDeprecation.description;
                     <label class="text-link plain" id="plugindeprecation-learnmore-link">&pluginDeprecation.learnMore;</label>
                   </description>
-                </vbox>
-              </vbox>
-              <vbox id="getthemes-container" class="alert-container">
-                <vbox class="alert">
-                  <description>&getThemes.description; &#160;
-                    <label class="text-link plain" id="getthemes-learnmore-link">&getThemes.learnMore;</label>
-                  </description>
-                </vbox>
+                </hbox>
               </vbox>
               <hbox class="view-header global-warning-container">
                 <!-- global warnings -->
                 <hbox class="global-warning" flex="1">
                   <hbox class="global-warning-safemode" flex="1" align="center"
                         tooltiptext="&warning.safemode.label;">
                     <image class="warning-icon"/>
                     <label class="global-warning-text" flex="1" crop="end"
--- a/toolkit/mozapps/extensions/test/browser/browser.ini
+++ b/toolkit/mozapps/extensions/test/browser/browser.ini
@@ -54,17 +54,16 @@ skip-if = os == "linux" && !debug # Bug 
 [browser_checkAddonCompatibility.js]
 [browser_details.js]
 [browser_discovery.js]
 [browser_dragdrop.js]
 [browser_dragdrop_incompat.js]
 [browser_extension_sideloading_permission.js]
 [browser_file_xpi_no_process_switch.js]
 skip-if = true # Bug 1449071 - Frequent failures
-[browser_getmorethemes.js]
 [browser_globalwarnings.js]
 [browser_gmpProvider.js]
 skip-if = os == 'linux' && !debug # Bug 1398766
 [browser_inlinesettings_browser.js]
 skip-if = os == 'mac' || os == 'linux' # Bug 1483347
 [browser_installssl.js]
 skip-if = verify
 [browser_langpack_signing.js]
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/browser/browser_getmorethemes.js
+++ /dev/null
@@ -1,46 +0,0 @@
-const MAIN_URL = "https://example.com/" + RELATIVE_DIR + "discovery.html";
-const PREF_GETTHEMESURL = "extensions.getAddons.themes.browseURL";
-
-add_task(async function getthemes_link_visible_on_appearance_when_pref_set() {
-  await SpecialPowers.pushPrefEnv({set: [[PREF_GETTHEMESURL, MAIN_URL]]});
-
-  let aManager = await open_manager("addons://list/extension");
-  info("Testing theme discovery information");
-  var button = aManager.document.querySelector("#getthemes-learnmore-link");
-  is_element_hidden(button, "Thume discovery button should be hidden");
-
-  info("Changing view to appearance");
-  EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("category-theme"), { }, aManager);
-
-  await new Promise(resolve => wait_for_view_load(aManager, resolve));
-  button = aManager.document.querySelector("#getthemes-learnmore-link");
-  is_element_visible(button, "Theme discovery message should be visible");
-
-  info("Clicking button to get more themes");
-  let awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, MAIN_URL);
-  EventUtils.synthesizeMouseAtCenter(button, { }, aManager);
-  await awaitNewTab;
-
-  is(gBrowser.currentURI.spec, Services.urlFormatter.formatURLPref(PREF_GETTHEMESURL), "Theme discovery URL should match");
-
-  BrowserTestUtils.removeTab(gBrowser.selectedTab);
-  await close_manager(aManager);
-});
-
-add_task(async function getthemes_link_hidden_on_appearance_when_pref_cleared() {
-  await SpecialPowers.pushPrefEnv({set: [[PREF_GETTHEMESURL, ""]]});
-
-  let aManager = await open_manager("addons://list/extension");
-  info("Testing theme discovery information");
-  var button = aManager.document.querySelector("#getthemes-learnmore-link");
-  is_element_hidden(button, "Thume discovery button should be hidden");
-
-  info("Changing view to appearance");
-  EventUtils.synthesizeMouseAtCenter(aManager.document.getElementById("category-theme"), { }, aManager);
-
-  await new Promise(resolve => wait_for_view_load(aManager, resolve));
-  button = aManager.document.querySelector("#getthemes-learnmore-link");
-  is_element_hidden(button, "Theme discovery message should be hidden");
-
-  await close_manager(aManager);
-});
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -807,23 +807,28 @@ xul|treechildren::-moz-tree-image(select
 }
 
 /* Message bars */
 .message-bar {
   background-color: var(--grey-20);
   border-radius: 4px;
   color: var(--grey-90);
   min-height: 32px;
+  -moz-box-align: center;
   padding: 4px;
 }
 
 .message-bar-description {
   line-height: 1.25;
 }
 
+.message-bar > description {
+  margin: 0;
+}
+
 /* The message-bar-button styles have extra specificity to override
  * the defaults for buttons. */
 .message-bar > hbox > .message-bar-button {
   background-color: var(--grey-90-a10);
   border: none;
   border-radius: 2px;
   height: 24px;
   margin-inline-start: 8px;