Bug 1521902: Remove unused argument from nsIShellService.isDefaultBrowser. r=rstrong,chutten

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dave Townsend 2019-01-24 20:08:14 +00:00
Родитель 892eb7ec20
Коммит 4980b117c6
6 изменённых файлов: 22 добавлений и 28 удалений

Просмотреть файл

@ -86,7 +86,7 @@ let ShellServiceInternal = {
this._checkedThisSession = true;
}
if (this.shellService) {
return this.shellService.isDefaultBrowser(startupCheck, forAllTypes);
return this.shellService.isDefaultBrowser(forAllTypes);
}
return false;
},

Просмотреть файл

@ -190,7 +190,7 @@ bool nsGNOMEShellService::CheckHandlerMatchesAppName(
}
NS_IMETHODIMP
nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck, bool aForAllTypes,
nsGNOMEShellService::IsDefaultBrowser(bool aForAllTypes,
bool *aIsDefaultBrowser) {
*aIsDefaultBrowser = false;

Просмотреть файл

@ -17,15 +17,11 @@ interface nsIShellService : nsISupports
* This is simply whether or not Firefox is registered to handle
* http links.
*
* @param aStartupCheck true if this is the check being performed
* by the first browser window at startup,
* false otherwise.
* @param aForAllTypes true if the check should be made for HTTP and HTML.
* false if the check should be made for HTTP only.
* This parameter may be ignored on some platforms.
*/
boolean isDefaultBrowser(in boolean aStartupCheck,
[optional] in boolean aForAllTypes);
boolean isDefaultBrowser([optional] in boolean aForAllTypes);
/**
* Registers Firefox as the "Default Browser."

Просмотреть файл

@ -40,7 +40,7 @@ NS_IMPL_ISUPPORTS(nsMacShellService, nsIMacShellService, nsIShellService,
nsIWebProgressListener)
NS_IMETHODIMP
nsMacShellService::IsDefaultBrowser(bool aStartupCheck, bool aForAllTypes,
nsMacShellService::IsDefaultBrowser(bool aForAllTypes,
bool* aIsDefaultBrowser) {
*aIsDefaultBrowser = false;

Просмотреть файл

@ -199,10 +199,8 @@ static nsresult GetAppRegName(nsAutoString& aAppRegName) {
}
NS_IMETHODIMP
nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck, bool aForAllTypes,
nsWindowsShellService::IsDefaultBrowser(bool aForAllTypes,
bool* aIsDefaultBrowser) {
mozilla::Unused << aStartupCheck;
*aIsDefaultBrowser = false;
RefPtr<IApplicationAssociationRegistration> pAAR;

Просмотреть файл

@ -1417,35 +1417,35 @@ EnvironmentCache.prototype = {
* @returns null on error, true if we are the default browser, or false otherwise.
*/
_isDefaultBrowser() {
let isDefault = (service, ...args) => {
try {
return !!service.isDefaultBrowser(...args);
} catch (ex) {
this._log.error("_isDefaultBrowser - Could not determine if default browser", ex);
return null;
}
};
if (!("@mozilla.org/browser/shell-service;1" in Cc)) {
this._log.info("_isDefaultBrowser - Could not obtain browser shell service");
return null;
}
let shellService;
try {
let scope = {};
ChromeUtils.import("resource:///modules/ShellService.jsm", scope);
shellService = scope.ShellService;
let { ShellService } = ChromeUtils.import("resource:///modules/ShellService.jsm", {});
// This uses the same set of flags used by the pref pane.
return isDefault(ShellService, false, true);
} catch (ex) {
this._log.error("_isDefaultBrowser - Could not obtain shell service JSM");
}
if (!shellService) {
try {
shellService = Cc["@mozilla.org/browser/shell-service;1"]
.getService(Ci.nsIShellService);
} catch (ex) {
this._log.error("_isDefaultBrowser - Could not obtain shell service", ex);
return null;
}
}
try {
// This uses the same set of flags used by the pref pane.
return !!shellService.isDefaultBrowser(false, true);
let shellService = Cc["@mozilla.org/browser/shell-service;1"]
.getService(Ci.nsIShellService);
// This uses the same set of flags used by the pref pane.
return isDefault(shellService, true);
} catch (ex) {
this._log.error("_isDefaultBrowser - Could not determine if default browser", ex);
this._log.error("_isDefaultBrowser - Could not obtain shell service", ex);
return null;
}
},