mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-26 08:21:34 +00:00
no-bug: Fix lints
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user