Bug 1484640 - Enable ESLint for mobile/android/chrome/content/browser.js (Manual Changes). r=snorp

Differential Revision: https://phabricator.services.mozilla.com/D22891

--HG--
extra : moz-landing-system : lando
This commit is contained in:
championshuttler 2019-03-16 13:13:00 +00:00
parent ff578b9c57
commit e2970d86c2
2 changed files with 22 additions and 25 deletions

View file

@ -266,9 +266,6 @@ mobile/android/chrome/content/about.js
mobile/android/installer/
mobile/android/locales/
# Non-standard `(catch ex if ...)`
mobile/android/chrome/content/browser.js
# Pre-processed/pref files
modules/libpref/greprefs.js
modules/libpref/init/all.js

View file

@ -1500,7 +1500,7 @@ var BrowserApp = {
}
BrowserApp.sanitize(aClear.sanitize, function() {
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
let appStartup = Services.startup;
appStartup.quit(Ci.nsIAppStartup.eForceQuit);
}, true);
},
@ -1722,6 +1722,7 @@ var BrowserApp = {
Services.prefs.setComplexValue(pref, Ci.nsIPrefLocalizedString, pls);
},
// eslint-disable-next-line complexity
onEvent: function(event, data, callback) {
let browser = this.selectedBrowser;
@ -1792,12 +1793,7 @@ var BrowserApp = {
Strings.flush();
// Make sure we use the right Accept-Language header.
let osLocale;
try {
// This should never not be set at this point, but better safe than sorry.
osLocale = Services.prefs.getCharPref("intl.locale.os");
} catch (e) {
}
let osLocale = Services.prefs.getCharPref("intl.locale.os");
this.computeAcceptLanguages(osLocale, data && data.languageTag);
break;
@ -1891,6 +1887,7 @@ var BrowserApp = {
// Remove the current host from the 'trackingprotection' consumer
// of the permission manager. This effectively removes this host
// from the tracking protection white list (any list actually).
// eslint-disable-next-line no-lonely-if
if (PrivateBrowsingUtils.isBrowserPrivate(browser)) {
PrivateBrowsingUtils.removeFromTrackingAllowlist(normalizedUrl);
} else {
@ -3498,6 +3495,7 @@ function nsBrowserAccess() {
nsBrowserAccess.prototype = {
QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserDOMWindow]),
// eslint-disable-next-line complexity
_getBrowser: function _getBrowser(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
let isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
if (isExternal && aURI && aURI.schemeIs("chrome"))
@ -3701,6 +3699,7 @@ function getBaseDomain(aURI) {
}
Tab.prototype = {
// eslint-disable-next-line complexity
create: function(aURL, aParams) {
if (this.browser)
return;
@ -4236,6 +4235,7 @@ Tab.prototype = {
return Services.io.newURI(url);
},
// eslint-disable-next-line complexity
handleEvent: function(aEvent) {
switch (aEvent.type) {
case "DOMContentLoaded": {
@ -4616,6 +4616,7 @@ Tab.prototype = {
}
},
// eslint-disable-next-line complexity
onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
let contentWin = aWebProgress.DOMWindow;
let webNav = contentWin.docShell.QueryInterface(Ci.nsIWebNavigation);
@ -5026,6 +5027,7 @@ var BrowserEventHandler = {
};
var ErrorPageEventHandler = {
// eslint-disable-next-line complexity
handleEvent: function(aEvent) {
switch (aEvent.type) {
case "click": {
@ -5092,7 +5094,7 @@ var ErrorPageEventHandler = {
let isIframe = (errorDoc.defaultView.parent === errorDoc.defaultView);
bucketName += isIframe ? "TOP_" : "FRAME_";
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
let formatter = Services.urlFormatter;
if (target == errorDoc.getElementById("getMeOutButton")) {
if (sendTelemetry) {
@ -5321,20 +5323,18 @@ var XPInstallObserver = {
if (needsRestart) {
this.showRestartPrompt();
} else {
} else if (!aInstall.existingAddon || !AddonManager.shouldAutoUpdate(aInstall.existingAddon)) {
// Display completion message for new installs or updates not done Automatically
if (!aInstall.existingAddon || !AddonManager.shouldAutoUpdate(aInstall.existingAddon)) {
let message = Strings.browser.GetStringFromName("alertAddonsInstalledNoRestart.message");
Snackbars.show(message, Snackbars.LENGTH_LONG, {
action: {
label: Strings.browser.GetStringFromName("alertAddonsInstalledNoRestart.action2"),
callback: () => {
UITelemetry.addEvent("show.1", "toast", null, "addons");
BrowserApp.selectOrAddTab("about:addons", { parentId: BrowserApp.selectedTab.id });
},
let message = Strings.browser.GetStringFromName("alertAddonsInstalledNoRestart.message");
Snackbars.show(message, Snackbars.LENGTH_LONG, {
action: {
label: Strings.browser.GetStringFromName("alertAddonsInstalledNoRestart.action2"),
callback: () => {
UITelemetry.addEvent("show.1", "toast", null, "addons");
BrowserApp.selectOrAddTab("about:addons", { parentId: BrowserApp.selectedTab.id });
},
});
}
},
});
}
},
@ -5407,10 +5407,10 @@ var XPInstallObserver = {
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
// If nothing aborted, quit the app
if (cancelQuit.data == false) {
if (!cancelQuit.data) {
Services.obs.notifyObservers(null, "quit-application-proceeding");
SharedPreferences.forApp().setBoolPref("browser.sessionstore.resume_session_once", true);
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
let appStartup = Services.startup;
appStartup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
}
},