From f5dcbb28bf87f1c138397ccb1a93145aecdbd074 Mon Sep 17 00:00:00 2001 From: Alex Kontos Date: Wed, 13 Sep 2023 11:27:53 +0100 Subject: [PATCH] Remove old code handling custom Waterfox themes. Also remove unnecessary setting of default theme. --- waterfox/browser/app/profile/01-theme.js | 1 - .../browser/components/WaterfoxGlue.sys.mjs | 3 ++- .../uicustomizations/UICustomizations.sys.mjs | 23 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/waterfox/browser/app/profile/01-theme.js b/waterfox/browser/app/profile/01-theme.js index 1050299194bb1..fc483d92813df 100644 --- a/waterfox/browser/app/profile/01-theme.js +++ b/waterfox/browser/app/profile/01-theme.js @@ -7,7 +7,6 @@ pref("browser.theme.enableWaterfoxCustomizations", 1); pref("browser.uidensity", 1); -pref("extensions.activeThemeID", "default-theme@mozilla.org"); // ** Theme Related Options **************************************************** // == Theme Distribution Settings ============================================== diff --git a/waterfox/browser/components/WaterfoxGlue.sys.mjs b/waterfox/browser/components/WaterfoxGlue.sys.mjs index 24923d0fe9f0f..7b464d232a920 100644 --- a/waterfox/browser/components/WaterfoxGlue.sys.mjs +++ b/waterfox/browser/components/WaterfoxGlue.sys.mjs @@ -305,9 +305,10 @@ export const WaterfoxGlue = { if (!Services.prefs.prefHasUserValue("browser.migration.waterfox_version")) { // This is a new profile, nothing to migrate. - waterfoxUIVersion.prefs.setIntPref("browser.migration.waterfox_version", waterfoxUIVersion); + Services.prefs.setIntPref("browser.migration.waterfox_version", waterfoxUIVersion); return; } + async function enableTheme(id) { const addon = await lazy.AddonManager.getAddonByID(id); // If we found it, enable it. diff --git a/waterfox/browser/components/uicustomizations/UICustomizations.sys.mjs b/waterfox/browser/components/uicustomizations/UICustomizations.sys.mjs index c97a6e6537ad0..aea9a7262bda6 100644 --- a/waterfox/browser/components/uicustomizations/UICustomizations.sys.mjs +++ b/waterfox/browser/components/uicustomizations/UICustomizations.sys.mjs @@ -11,9 +11,6 @@ import { BrowserUtils } from "resource:///modules/BrowserUtils.sys.mjs"; export const UICustomizations = { PREF_TOOLBARPOS: "browser.tabs.toolbarposition", PREF_BOOKMARKPOS: "browser.bookmarks.toolbarposition", - PREF_DEFAULTTHEME: "browser.lepton.enabled", - PREF_ACTIVETHEME: "extensions.activeThemeID", - DEFAULT_THEMEID: "lepton@waterfox.net", init(window) { this.styleButtonBox(window.document); @@ -22,15 +19,6 @@ export const UICustomizations = { this.moveBookmarksBar(window); this.initListeners(window); this.initPrefObservers(); - - // Make sure pref is aligned with active theme ID initially - let activeTheme = PrefUtils.get(this.PREF_ACTIVETHEME); - if ( - activeTheme != this.DEFAULT_THEMEID && - PrefUtils.get(this.PREF_DEFAULTTHEME) - ) { - this.setDefaultThemePref(activeTheme); - } }, initPrefObservers() { @@ -55,17 +43,6 @@ export const UICustomizations = { } ); - // If activeThemeID changes update default theme pref -> could expand to do more than just default or not - PrefUtils.addObserver(this.PREF_ACTIVETHEME, value => { - this.setDefaultThemePref(value); - }); - }, - - setDefaultThemePref(prefValue) { - PrefUtils.set( - this.PREF_DEFAULTTHEME, - prefValue === this.DEFAULT_THEMEID // Currently, only lepton displays icons - ); }, initListeners(aWindow) {