diff --git a/src/zen/drag-and-drop/nsZenDragAndDrop.h b/src/zen/drag-and-drop/nsZenDragAndDrop.h index b5f593ba1..7f672352e 100644 --- a/src/zen/drag-and-drop/nsZenDragAndDrop.h +++ b/src/zen/drag-and-drop/nsZenDragAndDrop.h @@ -2,8 +2,8 @@ * 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/. */ -#ifndef mozilla_ZenDragAndDrop_h__ -#define mozilla_ZenDragAndDrop_h__ +#ifndef mozilla_ZenDragAndDrop_h_ +#define mozilla_ZenDragAndDrop_h_ #include "nsIZenDragAndDrop.h" #include "nsCOMPtr.h" diff --git a/src/zen/mods/ZenStyleSheetCache.h b/src/zen/mods/ZenStyleSheetCache.h index cb16fbf85..84ed1815d 100644 --- a/src/zen/mods/ZenStyleSheetCache.h +++ b/src/zen/mods/ZenStyleSheetCache.h @@ -2,8 +2,8 @@ * 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/. */ -#ifndef mozilla_ZenStyleSheetCache_h__ -#define mozilla_ZenStyleSheetCache_h__ +#ifndef mozilla_ZenStyleSheetCache_h_ +#define mozilla_ZenStyleSheetCache_h_ #include "mozilla/css/Loader.h" #include "mozilla/StaticPtr.h" diff --git a/src/zen/mods/nsZenModsBackend.h b/src/zen/mods/nsZenModsBackend.h index 2929d7be1..58e30301b 100644 --- a/src/zen/mods/nsZenModsBackend.h +++ b/src/zen/mods/nsZenModsBackend.h @@ -2,8 +2,8 @@ * 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/. */ -#ifndef mozilla_ZenModsBackend_h__ -#define mozilla_ZenModsBackend_h__ +#ifndef mozilla_ZenModsBackend_h_ +#define mozilla_ZenModsBackend_h_ #include "nsIZenModsBackend.h" #include "nsIZenCommonUtils.h" diff --git a/src/zen/toolkit/common/ZenCommonUtils.h b/src/zen/toolkit/common/ZenCommonUtils.h index d940d0286..48cc03a6e 100644 --- a/src/zen/toolkit/common/ZenCommonUtils.h +++ b/src/zen/toolkit/common/ZenCommonUtils.h @@ -2,8 +2,8 @@ * 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/. */ -#ifndef mozilla_nsZenCommonUtils_h__ -#define mozilla_nsZenCommonUtils_h__ +#ifndef mozilla_nsZenCommonUtils_h_ +#define mozilla_nsZenCommonUtils_h_ #include "nsIZenCommonUtils.h" diff --git a/src/zen/toolkit/common/ZenShareInternal.h b/src/zen/toolkit/common/ZenShareInternal.h index c3c53f5b7..41046942f 100644 --- a/src/zen/toolkit/common/ZenShareInternal.h +++ b/src/zen/toolkit/common/ZenShareInternal.h @@ -2,8 +2,8 @@ * 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/. */ -#ifndef mozilla_nsZenShareInternal_h__ -#define mozilla_nsZenShareInternal_h__ +#ifndef mozilla_nsZenShareInternal_h_ +#define mozilla_nsZenShareInternal_h_ #include "nsIZenCommonUtils.h" diff --git a/src/zen/urlbar/ZenUBProvider.sys.mjs b/src/zen/urlbar/ZenUBProvider.sys.mjs index cd1d65c1e..0ff005228 100644 --- a/src/zen/urlbar/ZenUBProvider.sys.mjs +++ b/src/zen/urlbar/ZenUBProvider.sys.mjs @@ -2,7 +2,7 @@ * 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/. */ -import { UrlbarProvidersManager } from "moz-src:///browser/components/urlbar/UrlbarProvidersManager.sys.mjs"; +import { ProvidersManager } from "moz-src:///browser/components/urlbar/UrlbarProvidersManager.sys.mjs"; const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { @@ -12,11 +12,12 @@ ChromeUtils.defineESModuleGetters(lazy, { }); export function registerZenUrlbarProviders() { + let instance = ProvidersManager.getInstanceForSap("urlbar"); for (let i = 0; i < Object.keys(lazy).length; i++) { const provider = Object.values(lazy)[i]; const name = Object.keys(lazy)[i]; - if (!UrlbarProvidersManager.getProvider(name)) { - UrlbarProvidersManager.registerProvider(new provider()); + if (!instance.getProvider(name)) { + instance.registerProvider(new provider()); } } } diff --git a/src/zen/welcome/ZenWelcome.mjs b/src/zen/welcome/ZenWelcome.mjs index 59806986b..9ccee0934 100644 --- a/src/zen/welcome/ZenWelcome.mjs +++ b/src/zen/welcome/ZenWelcome.mjs @@ -4,6 +4,11 @@ { let _tabsToPinEssentials = []; + let lazy = {}; + + ChromeUtils.defineESModuleGetters(lazy, { + SearchService: "moz-src:///toolkit/components/search/SearchService.sys.mjs", + }); const kZenElementsToIgnore = [ "zen-browser-background", @@ -77,9 +82,6 @@ return data; } - /** - * - */ class nsZenWelcomePages { constructor(pages) { this._currentPage = -1; @@ -300,16 +302,13 @@ } } - /** - * - */ class ZenSearchEngineStore { constructor() { this._engines = []; } async init() { - const visibleEngines = await Services.search.getVisibleEngines(); + const visibleEngines = await lazy.SearchService.getVisibleEngines(); this.initSpecificEngine(visibleEngines); } @@ -351,12 +350,12 @@ } async getDefaultEngine() { - let engineName = await Services.search.getDefault(); + let engineName = await lazy.SearchService.getDefault(); return this.getEngineByName(engineName._name); } async setDefaultEngine(engine) { - await Services.search.setDefault( + await lazy.SearchService.setDefault( engine.originalEngine, Ci.nsISearchService.CHANGE_REASON_USER ); @@ -460,7 +459,7 @@ content.setAttribute("select-engine", "true"); - const defaultEngine = await Services.search.getDefault(); + const defaultEngine = await lazy.SearchService.getDefault(); const promises = []; engineStore.getEngines().forEach(engine => { const label = document.createElement("label");