Bug 1386004 - Use theming API for Photon Dark and Light themes. draft
authorTim Nguyen <ntim.bugs@gmail.com>
Thu, 04 Jan 2018 02:52:16 +0100
changeset 715541 80043a52939b52736edac48e8bffee3019363597
parent 715485 6f98c6b22ae6bda54a61859c74a5fd8d0e610741
child 744810 134c4495e7101277334fa6d6b69c728d9c169cab
push id94177
push userbmo:ntim.bugs@gmail.com
push dateThu, 04 Jan 2018 01:53:08 +0000
bugs1386004
milestone59.0a1
Bug 1386004 - Use theming API for Photon Dark and Light themes. MozReview-Commit-ID: KDEwMkv2HO4
browser/base/content/browser-compacttheme.js
browser/base/content/browser.js
browser/base/content/defaultthemes/dark.icon.svg
browser/base/content/defaultthemes/light.icon.svg
browser/base/content/global-scripts.inc
browser/base/jar.mn
browser/components/nsBrowserGlue.js
browser/extensions/moz.build
browser/extensions/theme-dark/_locales/en_US/messages.json
browser/extensions/theme-dark/icon.svg
browser/extensions/theme-dark/manifest.json
browser/extensions/theme-dark/moz.build
browser/extensions/theme-light/_locales/en_US/messages.json
browser/extensions/theme-light/icon.svg
browser/extensions/theme-light/manifest.json
browser/extensions/theme-light/moz.build
browser/themes/linux/compacttheme.css
browser/themes/linux/jar.mn
browser/themes/osx/compacttheme.css
browser/themes/osx/jar.mn
browser/themes/shared/compacttheme.inc.css
browser/themes/windows/compacttheme.css
browser/themes/windows/jar.mn
toolkit/components/extensions/schemas/theme.json
toolkit/mozapps/extensions/internal/XPIProvider.jsm
deleted file mode 100644
--- a/browser/base/content/browser-compacttheme.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Listeners for the compact theme.  This adds an extra stylesheet
- * to browser.xul if a pref is set and no other themes are applied.
- */
-var CompactTheme = {
-  styleSheetLocation: "chrome://browser/skin/compacttheme.css",
-  styleSheet: null,
-
-  get isStyleSheetEnabled() {
-    return this.styleSheet && !this.styleSheet.sheet.disabled;
-  },
-
-  get isThemeCurrentlyApplied() {
-    let theme = LightweightThemeManager.currentTheme;
-    return theme && (
-           theme.id == "firefox-compact-dark@mozilla.org" ||
-           theme.id == "firefox-compact-light@mozilla.org");
-  },
-
-  init() {
-    Services.obs.addObserver(this, "lightweight-theme-styling-update");
-
-    if (this.isThemeCurrentlyApplied) {
-      this._toggleStyleSheet(true);
-    }
-  },
-
-  createStyleSheet() {
-    let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`;
-    this.styleSheet = document.createProcessingInstruction(
-      "xml-stylesheet", styleSheetAttr);
-    document.insertBefore(this.styleSheet, document.documentElement);
-    this.styleSheet.sheet.disabled = true;
-  },
-
-  observe(subject, topic, data) {
-    if (topic == "lightweight-theme-styling-update") {
-      let newTheme = JSON.parse(data);
-      if (newTheme && (
-          newTheme.id == "firefox-compact-light@mozilla.org" ||
-          newTheme.id == "firefox-compact-dark@mozilla.org")) {
-        // We are using the theme ID on this object instead of always referencing
-        // LightweightThemeManager.currentTheme in case this is a preview
-        this._toggleStyleSheet(true);
-      } else {
-        this._toggleStyleSheet(false);
-      }
-
-    }
-  },
-
-  _toggleStyleSheet(enabled) {
-    let wasEnabled = this.isStyleSheetEnabled;
-    if (enabled) {
-      // The stylesheet may not have been created yet if it wasn't
-      // needed on initial load.  Make it now.
-      if (!this.styleSheet) {
-        this.createStyleSheet();
-      }
-      this.styleSheet.sheet.disabled = false;
-    } else if (!enabled && wasEnabled) {
-      this.styleSheet.sheet.disabled = true;
-    }
-  },
-
-  uninit() {
-    Services.obs.removeObserver(this, "lightweight-theme-styling-update");
-    this.styleSheet = null;
-  }
-};
-
-// If the compact theme is going to be applied in gBrowserInit.onLoad,
-// then preload it now.  This prevents a flash of unstyled content where the
-// normal theme is applied while the compact theme stylesheet is loading.
-if (this != Services.appShell.hiddenDOMWindow && CompactTheme.isThemeCurrentlyApplied) {
-  CompactTheme.createStyleSheet();
-}
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1248,17 +1248,16 @@ var gBrowserInit = {
     // loading the frame script to ensure that we don't miss any
     // message sent between when the frame script is loaded and when
     // the listener is registered.
     DOMEventHandler.init();
     gPageStyleMenu.init();
     LanguageDetectionListener.init();
     BrowserOnClick.init();
     FeedHandler.init();
-    CompactTheme.init();
     AboutPrivateBrowsingListener.init();
     TrackingProtection.init();
     CaptivePortalWatcher.init();
     ZoomUI.init(window);
 
     let mm = window.getGroupMessageManager("browsers");
     mm.loadFrameScript("chrome://browser/content/tab-content.js", true);
     mm.loadFrameScript("chrome://browser/content/content.js", true);
@@ -1801,18 +1800,16 @@ var gBrowserInit = {
     TabletModeUpdater.uninit();
 
     gTabletModePageCounter.finish();
 
     BrowserOnClick.uninit();
 
     FeedHandler.uninit();
 
-    CompactTheme.uninit();
-
     TrackingProtection.uninit();
 
     CaptivePortalWatcher.uninit();
 
     SidebarUI.uninit();
 
     DownloadsButton.uninit();
 
--- a/browser/base/content/global-scripts.inc
+++ b/browser/base/content/global-scripts.inc
@@ -9,17 +9,16 @@
 
 <script type="application/javascript">
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 for (let script of [
   "chrome://browser/content/browser.js",
 
   "chrome://browser/content/browser-captivePortal.js",
-  "chrome://browser/content/browser-compacttheme.js",
   "chrome://browser/content/browser-feeds.js",
   "chrome://browser/content/browser-media.js",
   "chrome://browser/content/browser-pageActions.js",
   "chrome://browser/content/browser-places.js",
   "chrome://browser/content/browser-plugins.js",
   "chrome://browser/content/browser-sidebar.js",
   "chrome://browser/content/browser-tabsintitlebar.js",
   "chrome://browser/content/browser-trackingprotection.js",
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -50,17 +50,16 @@ browser.jar:
 *       content/browser/browser.css                   (content/browser.css)
         content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
         content/browser/browser-addons.js             (content/browser-addons.js)
         content/browser/browser-captivePortal.js      (content/browser-captivePortal.js)
         content/browser/browser-ctrlTab.js            (content/browser-ctrlTab.js)
         content/browser/browser-customization.js      (content/browser-customization.js)
         content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js)
-        content/browser/browser-compacttheme.js       (content/browser-compacttheme.js)
 #ifndef MOZILLA_OFFICIAL
         content/browser/browser-development-helpers.js (content/browser-development-helpers.js)
 #endif
         content/browser/browser-feeds.js              (content/browser-feeds.js)
         content/browser/browser-fullScreenAndPointerLock.js  (content/browser-fullScreenAndPointerLock.js)
         content/browser/browser-fullZoom.js           (content/browser-fullZoom.js)
         content/browser/browser-gestureSupport.js     (content/browser-gestureSupport.js)
         content/browser/browser-media.js              (content/browser-media.js)
@@ -92,18 +91,16 @@ browser.jar:
         content/browser/defaultthemes/3.preview.png   (content/defaultthemes/3.preview.png)
         content/browser/defaultthemes/4.header.png    (content/defaultthemes/4.header.png)
         content/browser/defaultthemes/4.icon.png      (content/defaultthemes/4.icon.png)
         content/browser/defaultthemes/4.preview.png   (content/defaultthemes/4.preview.png)
         content/browser/defaultthemes/5.header.png    (content/defaultthemes/5.header.png)
         content/browser/defaultthemes/5.icon.jpg      (content/defaultthemes/5.icon.jpg)
         content/browser/defaultthemes/5.preview.jpg   (content/defaultthemes/5.preview.jpg)
         content/browser/defaultthemes/compact.header.png    (content/defaultthemes/compact.header.png)
-        content/browser/defaultthemes/dark.icon.svg  (content/defaultthemes/dark.icon.svg)
-        content/browser/defaultthemes/light.icon.svg (content/defaultthemes/light.icon.svg)
         content/browser/newtab/newTab.xhtml           (content/newtab/newTab.xhtml)
 *       content/browser/newtab/newTab.js              (content/newtab/newTab.js)
         content/browser/newtab/newTab.css             (content/newtab/newTab.css)
         content/browser/newtab/alternativeDefaultSites.json   (content/newtab/alternativeDefaultSites.json)
 *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
         content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
         content/browser/pageinfo/pageInfo.css         (content/pageinfo/pageInfo.css)
         content/browser/pageinfo/feeds.js             (content/pageinfo/feeds.js)
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -637,40 +637,16 @@ BrowserGlue.prototype = {
 
     // handle any UI migration
     this._migrateUI();
 
     listeners.init();
 
     SessionStore.init();
 
-    let vendorShortName = gBrandBundle.GetStringFromName("vendorShortName");
-
-    LightweightThemeManager.addBuiltInTheme({
-      id: "firefox-compact-light@mozilla.org",
-      name: gBrowserBundle.GetStringFromName("lightTheme.name"),
-      description: gBrowserBundle.GetStringFromName("lightTheme.description"),
-      headerURL: "resource:///chrome/browser/content/browser/defaultthemes/compact.header.png",
-      iconURL: "resource:///chrome/browser/content/browser/defaultthemes/light.icon.svg",
-      textcolor: "black",
-      accentcolor: "white",
-      author: vendorShortName,
-    });
-    LightweightThemeManager.addBuiltInTheme({
-      id: "firefox-compact-dark@mozilla.org",
-      name: gBrowserBundle.GetStringFromName("darkTheme.name"),
-      description: gBrowserBundle.GetStringFromName("darkTheme.description"),
-      headerURL: "resource:///chrome/browser/content/browser/defaultthemes/compact.header.png",
-      iconURL: "resource:///chrome/browser/content/browser/defaultthemes/dark.icon.svg",
-      textcolor: "white",
-      accentcolor: "black",
-      author: vendorShortName,
-    });
-
-
     // Initialize the default l10n resource sources for L10nRegistry.
     const multilocalePath = "resource://gre/res/multilocale.json";
     L10nRegistry.bootstrap = fetch(multilocalePath).then(d => d.json()).then(({ locales }) => {
       const toolkitSource = new FileSource("toolkit", locales, "resource://gre/localization/{locale}/");
       L10nRegistry.registerSource(toolkitSource);
       const appSource = new FileSource("app", locales, "resource://app/localization/{locale}/");
       L10nRegistry.registerSource(appSource);
     }).catch(e => {
--- a/browser/extensions/moz.build
+++ b/browser/extensions/moz.build
@@ -9,16 +9,18 @@ DIRS += [
     'aushelper',
     'followonsearch',
     'formautofill',
     'onboarding',
     'pdfjs',
     'pocket',
     'screenshots',
     'shield-recipe-client',
+    'theme-dark',
+    'theme-light',
     'webcompat',
 ]
 
 # Only include the following system add-ons if building Aurora or Nightly
 if not CONFIG['RELEASE_OR_BETA']:
     DIRS += [
         'presentation',
     ]
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-dark/_locales/en_US/messages.json
@@ -0,0 +1,11 @@
+{
+  "themeName": {
+    "message": "Dark",
+    "description": "Name of the theme."
+  },
+
+  "themeDescription": {
+    "message": "A theme with a dark color scheme.",
+    "description": "Description of the theme."
+  }
+}
\ No newline at end of file
rename from browser/base/content/defaultthemes/dark.icon.svg
rename to browser/extensions/theme-dark/icon.svg
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-dark/manifest.json
@@ -0,0 +1,32 @@
+{
+  "manifest_version": 2,
+  "name": "__MSG_themeName__",
+  "version": "1.0",
+  "description": "__MSG_themeDescription__",
+  "icons": {
+    "48": "icon.svg",
+    "96": "icon.svg"
+  },
+  "default_locale": "en_US",
+  "theme": {
+    "images": {
+      "headerURL": ""
+    },
+    "colors": {
+      "accentcolor": "#0c0c0d",
+      "textcolor": "rgb(249, 249, 250)",
+      "toolbar": "#323234",
+      "toolbar_text": "#cacacb",
+      "toolbar_field": "#474749",
+      "toolbar_field_text": "rgb(249, 249, 250)",
+      "toolbar_bottom_separator": "hsla(240, 5%, 5%, .1)",
+      "toolbar_vertical_separator": "#5F6670"
+   }
+  },
+  "author": "Mozilla",
+  "applications": {
+    "gecko": {
+      "id": "firefox-compact-dark@mozilla.org"
+    }
+  }
+}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-dark/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files("**"):
+    BUG_COMPONENT = ("Firefox", "Theme")
+
+FINAL_TARGET_FILES.features['firefox-compact-dark@mozilla.org'] += [
+  'icon.svg',
+  'manifest.json'
+]
+
+FINAL_TARGET_FILES.features['firefox-compact-dark@mozilla.org']["_locales"]["en_US"] += [
+  '_locales/en_US/messages.json'
+]
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-light/_locales/en_US/messages.json
@@ -0,0 +1,11 @@
+{
+  "themeName": {
+    "message": "Light",
+    "description": "Name of the theme."
+  },
+
+  "themeDescription": {
+    "message": "A theme with a light color scheme.",
+    "description": "Description of the theme."
+  }
+}
\ No newline at end of file
rename from browser/base/content/defaultthemes/light.icon.svg
rename to browser/extensions/theme-light/icon.svg
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-light/manifest.json
@@ -0,0 +1,29 @@
+{
+  "manifest_version": 2,
+  "name": "__MSG_themeName__",
+  "version": "1.0",
+  "description": "__MSG_themeDescription__",
+  "icons": {
+    "48": "icon.svg",
+    "96": "icon.svg"
+  },
+  "default_locale": "en_US",
+  "theme": {
+    "images": {
+      "headerURL": ""
+    },
+    "colors": {
+      "accentcolor": "#e3e4e6",
+      "textcolor": "#18191a",
+      "toolbar": "#f5f6f7",
+      "toolbar_field": "white",
+      "toolbar_bottom_separator": "#cccccc"
+   }
+  },
+  "author": "Mozilla",
+  "applications": {
+    "gecko": {
+      "id": "firefox-compact-light@mozilla.org"
+    }
+  }
+}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/theme-light/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files("**"):
+    BUG_COMPONENT = ("Firefox", "Theme")
+
+FINAL_TARGET_FILES.features['firefox-compact-light@mozilla.org'] += [
+  'icon.svg',
+  'manifest.json'
+]
+
+FINAL_TARGET_FILES.features['firefox-compact-light@mozilla.org']["_locales"]["en_US"] += [
+  '_locales/en_US/messages.json'
+]
\ No newline at end of file
deleted file mode 100644
--- a/browser/themes/linux/compacttheme.css
+++ /dev/null
@@ -1,19 +0,0 @@
-% This Source Code Form is subject to the terms of the Mozilla Public
-% License, v. 2.0. If a copy of the MPL was not distributed with this
-% file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-%include ../shared/compacttheme.inc.css
-
-/* The menubar and tabs toolbar should match the devedition theme */
-#TabsToolbar,
-#toolbar-menubar {
-  -moz-appearance: none !important;
-}
-#main-menubar {
-  color: var(--chrome-color);
-}
-#main-menubar > menu:not([open]) {
-  color: inherit;
-}
-
-
--- a/browser/themes/linux/jar.mn
+++ b/browser/themes/linux/jar.mn
@@ -5,17 +5,16 @@
 browser.jar:
 % skin browser classic/1.0 %skin/classic/browser/
 % override chrome://global/skin/icons/warning-16.png moz-icon://stock/gtk-dialog-warning?size=menu
 #include ../shared/jar.inc.mn
   skin/classic/browser/sanitizeDialog.css
   skin/classic/browser/aboutSessionRestore-window-icon.png
 * skin/classic/browser/syncedtabs/sidebar.css     (syncedtabs/sidebar.css)
 * skin/classic/browser/browser.css
-* skin/classic/browser/compacttheme.css
   skin/classic/browser/monitor.png
   skin/classic/browser/monitor_16-10.png
 * skin/classic/browser/pageInfo.css
   skin/classic/browser/pageInfo.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/searchbar.css
   skin/classic/browser/setDesktopBackground.css
   skin/classic/browser/slowStartup-16.png
deleted file mode 100644
--- a/browser/themes/osx/compacttheme.css
+++ /dev/null
@@ -1,15 +0,0 @@
-% This Source Code Form is subject to the terms of the Mozilla Public
-% License, v. 2.0. If a copy of the MPL was not distributed with this
-% file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-%include ../shared/compacttheme.inc.css
-
-/* Get rid of 1px bright strip at the top of window */
-#main-window[tabsintitlebar] #titlebar-content {
-  background: var(--chrome-background-color);
-}
-
-#TabsToolbar:-moz-lwtheme-darktext {
-  -moz-appearance: -moz-mac-vibrant-titlebar-light;
-  -moz-font-smoothing-background-color: -moz-mac-vibrant-titlebar-light;
-}
--- a/browser/themes/osx/jar.mn
+++ b/browser/themes/osx/jar.mn
@@ -4,17 +4,16 @@
 
 browser.jar:
 % skin browser classic/1.0 %skin/classic/browser/
 #include ../shared/jar.inc.mn
   skin/classic/browser/sanitizeDialog.css
   skin/classic/browser/aboutSessionRestore-window-icon.png
 * skin/classic/browser/syncedtabs/sidebar.css          (syncedtabs/sidebar.css)
 * skin/classic/browser/browser.css
-* skin/classic/browser/compacttheme.css
   skin/classic/browser/subtle-pattern.png
   skin/classic/browser/panel-expander-closed.png
   skin/classic/browser/panel-expander-closed@2x.png
   skin/classic/browser/panel-expander-open.png
   skin/classic/browser/panel-expander-open@2x.png
   skin/classic/browser/panel-plus-sign.png
   skin/classic/browser/page-livemarks.png
 * skin/classic/browser/pageInfo.css
deleted file mode 100644
--- a/browser/themes/shared/compacttheme.inc.css
+++ /dev/null
@@ -1,115 +0,0 @@
-% This Source Code Form is subject to the terms of the Mozilla Public
-% License, v. 2.0. If a copy of the MPL was not distributed with this
-% file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-/* compacttheme.css is loaded in browser.xul after browser.css when it is
-   preffed on.  The bulk of the styling is here in the shared file, but
-   there are overrides for each platform in their compacttheme.css files. */
-
-:root:-moz-lwtheme {
-  text-shadow: none;
-
-  --toolbar-bgcolor: var(--chrome-secondary-background-color);
-  --toolbar-gbimage: none;
-  --toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor);
-  --toolbar-non-lwt-textcolor: var(--chrome-color);
-  --toolbar-non-lwt-bgimage: none;
-
-  --toolbarbutton-icon-fill-opacity: .7;
-
-  --tab-line-color: #0a84ff;
-}
-
-:root:-moz-lwtheme-brighttext {
-  /* Chrome */
-  --chrome-background-color: hsl(240, 5%, 5%);
-  --chrome-color: rgb(249, 249, 250);
-  --chrome-secondary-background-color: hsl(240, 1%, 20%);
-  --toolbox-border-bottom-color: hsla(240, 5%, 5%, .1);
-  --chrome-nav-bar-separator-color: rgba(0,0,0,.2);
-  --chrome-nav-buttons-background: hsla(240, 5%, 5%, .1);
-  --chrome-nav-buttons-hover-background: hsla(240, 5%, 5%, .15);
-  --chrome-nav-bar-controls-border-color: hsla(240, 5%, 5%, .3);
-  --chrome-selection-color: #fff;
-  --chrome-selection-background-color: #5675B9;
-
-  /* Url and search bars */
-  --url-and-searchbar-background-color: rgb(71, 71, 73);
-  --url-and-searchbar-color: var(--chrome-color);
-  --urlbar-separator-color: #5F6670;
-}
-
-:root:-moz-lwtheme-darktext {
-  --url-and-searchbar-background-color: #fff;
-
-  --chrome-background-color: #E3E4E6;
-  --chrome-color: #18191a;
-  --chrome-secondary-background-color: #f5f6f7;
-  --toolbox-border-bottom-color: #cccccc;
-  --chrome-nav-bar-separator-color: #B6B6B8;
-  --chrome-nav-buttons-background: #ffffff; /* --theme-body-background */
-  --chrome-nav-buttons-hover-background: #DADBDB;
-  --chrome-nav-bar-controls-border-color: #ccc;
-  --chrome-selection-color: #f5f7fa;
-  --chrome-selection-background-color: #4c9ed9;
-}
-
-.toolbarbutton-animatable-box[brighttext],
-toolbar[brighttext] .toolbarbutton-animatable-box,
-toolbar[brighttext] .toolbarbutton-1 {
-  fill: rgb(249, 249, 250);
-}
-
-#urlbar ::-moz-selection,
-#navigator-toolbox .searchbar-textbox ::-moz-selection,
-.browserContainer > findbar ::-moz-selection {
-  background-color: var(--chrome-selection-background-color);
-  color: var(--chrome-selection-color);
-}
-
-/* Change the base colors for the browser chrome */
-
-#TabsToolbar,
-#browser-panel {
-  background: var(--chrome-background-color);
-  color: var(--chrome-color);
-}
-
-#navigator-toolbox > toolbar:not(#TabsToolbar):not(#toolbar-menubar),
-.browserContainer > findbar,
-#browser-bottombox {
-  background-color: var(--chrome-secondary-background-color) !important;
-  background-image: none !important;
-  color: var(--chrome-color);
-}
-
-/* Default findbar text color doesn't look good - Bug 1125677 */
-.browserContainer > findbar .findbar-find-status,
-.browserContainer > findbar .found-matches,
-.browserContainer > findbar .findbar-button {
-  color: inherit;
-}
-
-/* URL bar and search bar*/
-#urlbar:not([focused="true"]),
-.searchbar-textbox:not([focused="true"]) {
-  border-color: var(--chrome-nav-bar-controls-border-color);
-}
-
-#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity > #identity-icon-labels:-moz-lwtheme-brighttext {
-  color: #30e60b;
-}
-
-#urlbar-zoom-button:-moz-lwtheme-brighttext:hover {
-  background-color: rgba(255,255,255,.2);
-}
-
-#urlbar-zoom-button:-moz-lwtheme-brighttext:hover:active {
-  background-color: rgba(255,255,255,.3);
-}
-
-.tab-icon-sound[soundplaying],
-.tab-icon-sound[muted] {
-  filter: none !important; /* removes drop-shadow filter */
-}
-
deleted file mode 100644
--- a/browser/themes/windows/compacttheme.css
+++ /dev/null
@@ -1,177 +0,0 @@
-% This Source Code Form is subject to the terms of the Mozilla Public
-% License, v. 2.0. If a copy of the MPL was not distributed with this
-% file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-%include ../shared/compacttheme.inc.css
-
-:root {
-   /* Matches the #browser-border-start, #browser-border-end color */
-  --chrome-nav-bar-separator-color: rgba(10, 31, 51, 0.35);
-}
-
-/* The window background is white due to no accentcolor in the lightweight
-   theme. It can't be changed to transparent when there is no compositor
-   (Win 7 in classic / basic theme), or else dragging and focus become
-   broken. So instead just show the normal titlebar in that case, and override
-   the window color as transparent when the compositor is available. */
-@media (-moz-windows-compositor: 0) {
-  #main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
-    visibility: visible;
-  }
-
-  /* Prevent accent color overriding the window background for
-   * light and dark theme on Aero Basic. This is copied from browser-aero.css. */
-  @media (-moz-windows-default-theme) {
-    #main-window {
-      background-color: rgb(185,209,234) !important;
-    }
-    #main-window:-moz-window-inactive {
-      background-color: rgb(215,228,242) !important;
-    }
-  }
-}
-
-#toolbar-menubar {
-  text-shadow: none !important;
-}
-
-@media (-moz-os-version: windows-win7) {
-  @media (-moz-windows-default-theme) {
-    /* Always show light toolbar elements on aero surface. */
-    #TabsToolbar {
-      color: hsl(240,9%,98%);
-    }
-
-    /* Keep showing the correct color inside the tabs. */
-    .tabbrowser-tab {
-      color: var(--chrome-color) !important;
-    }
-
-    /* Because we're forcing the tabs toolbar to be [brighttext] to
-     * get white toolbar button icons, we need to manually set the
-     * correct color for the tab hover state for the light theme. */
-    .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]):-moz-lwtheme-darktext {
-      background-color: rgba(0,0,0,.1) !important;
-    }
-    .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]):-moz-lwtheme-darktext {
-      background-color: rgba(0,0,0,.2) !important;
-    }
-  }
-}
-
-@media (-moz-windows-glass) {
-  /* Set to full fill-opacity to improve visibility of toolbar buttons on aero glass. */
-  #TabsToolbar {
-    --toolbarbutton-icon-fill-opacity: 1;
-  }
-
-  /* Make the menubar text readable on aero glass (copied from browser-aero.css). */
-  #toolbar-menubar {
-    text-shadow: 0 0 .5em white, 0 0 .5em white, 0 1px 0 rgba(255,255,255,.4);
-  }
-
-  #main-menubar:not(:-moz-window-inactive) {
-    background-color: rgba(255,255,255,.5);
-    color: black;
-    border-radius: 4px;
-  }
-}
-
-@media (-moz-os-version: windows-win7),
-       (-moz-os-version: windows-win8) {
-  @media (-moz-windows-compositor) {
-    #main-window {
-      background: transparent !important;
-    }
-
-    /* Remove lwtheme borders from toolbars in non-maximized windows. */
-    #toolbar-menubar,
-    #TabsToolbar {
-      border-left-style: none !important;
-      border-right-style: none !important;
-    }
-  }
-
-  /* Always show full-height tab separators on tabs with borders. */
-  .tabbrowser-tab::before,
-  .tabbrowser-tab::after {
-    border-image: none !important;
-  }
-
-  /* Show border on tabs with background colors and
-   * show the tabs toolbar background color inside tabs. */
-  .tabbrowser-tab {
-    background-color: var(--chrome-background-color) !important;
-    border-top: 1px solid var(--tabs-border-color);
-    background-clip: padding-box;
-  }
-
-  /* The top border on top of the tab background is replaced
-   * by the slightly transparent outside tabs-border-color. */
-  .tab-background {
-    border-top-style: none !important;
-  }
-
-  /* The border at the end of the tab strip is replaced
-   * by the slightly transparent outside tabs-border-color. */
-  .tabbrowser-tab[last-visible-tab] {
-    border-inline-end: 1px solid var(--tabs-border-color);
-  }
-
-  .tabbrowser-tab[last-visible-tab]::after {
-    display: none !important;
-  }
-
-  /* Use default window colors when in non-maximized mode */
-  #tabbrowser-tabs,
-  #TabsToolbar,
-  #browser-panel,
-  #titlebar-content {
-    background: transparent;
-  }
-
-  /* Use proper menu text styling in Win7 classic mode (copied from browser.css) */
-  @media (-moz-windows-compositor: 0),
-         (-moz-windows-default-theme: 0) {
-    :root[tabsintitlebar]:not([inFullscreen]) {
-      --titlebar-text-color: CaptionText;
-    }
-
-    :root[tabsintitlebar]:not([inFullscreen]):-moz-window-inactive {
-      --titlebar-text-color: InactiveCaptionText;
-    }
-
-    #main-window[tabsintitlebar] #main-menubar > menu {
-      color: inherit;
-    }
-  }
-}
-
-/* Restored windows get an artificial border on windows, because the lwtheme background
- * overlaps the regular window border. That isn't the case for us, so we avoid painting
- * over the native border with our custom borders: */
-#browser-panel {
-  /* These are !important to avoid specificity-wars with the selectors that add borders here. */
-  background-image: none !important;
-  border-top: none !important;
-}
-
-@media (-moz-os-version: windows-win10) {
-  .titlebar-button:-moz-lwtheme {
-    -moz-context-properties: stroke;
-    stroke: currentColor;
-  }
-  #titlebar-min:-moz-lwtheme {
-    list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
-  }
-  #titlebar-max:-moz-lwtheme {
-    list-style-image: url(chrome://browser/skin/window-controls/maximize.svg);
-  }
-  :root[sizemode="maximized"] #titlebar-max:-moz-lwtheme {
-    list-style-image: url(chrome://browser/skin/window-controls/restore.svg);
-  }
-  #titlebar-close:-moz-lwtheme {
-    list-style-image: url(chrome://browser/skin/window-controls/close.svg);
-  }
-}
-
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -4,17 +4,16 @@
 
 browser.jar:
 % skin browser classic/1.0 %skin/classic/browser/
 #include ../shared/jar.inc.mn
   skin/classic/browser/sanitizeDialog.css
   skin/classic/browser/aboutSessionRestore-window-icon.png
 * skin/classic/browser/syncedtabs/sidebar.css     (syncedtabs/sidebar.css)
 * skin/classic/browser/browser.css
-* skin/classic/browser/compacttheme.css
   skin/classic/browser/monitor.png
   skin/classic/browser/monitor_16-10.png
   skin/classic/browser/pageInfo.css
   skin/classic/browser/pageInfo.png
   skin/classic/browser/searchbar.css
   skin/classic/browser/setDesktopBackground.css
   skin/classic/browser/slowStartup-16.png
   skin/classic/browser/sync-desktopIcon.svg  (../shared/sync-desktopIcon.svg)
--- a/toolkit/components/extensions/schemas/theme.json
+++ b/toolkit/components/extensions/schemas/theme.json
@@ -496,16 +496,20 @@
             "$ref": "ThemeType"
           },
           "icons": {
             "type": "object",
             "optional": true,
             "patternProperties": {
               "^[1-9]\\d*$": { "type": "string" }
             }
+          },
+          "default_locale": {
+            "type": "string",
+            "optional": "true"
           }
         }
       }
     ]
   },
   {
     "namespace": "theme",
     "description": "The theme API allows customizing of visual elements of the browser.",
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -5583,17 +5583,17 @@ AddonWrapper.prototype = {
     return val;
   },
 
   get hidden() {
     let addon = addonFor(this);
     if (addon._installLocation.name == KEY_APP_TEMPORARY)
       return false;
 
-    return addon._installLocation.isSystem;
+    return addon._installLocation.isSystem && this.type !== "theme";
   },
 
   get isSystem() {
     let addon = addonFor(this);
     return addon._installLocation.isSystem;
   },
 
   // Returns true if Firefox Sync should sync this addon. Only non-hotfixes