Browse Source

[Navigator] Fix ShellService.jsm

master
Matt A. Tobin 2 years ago committed by Roy Tam
parent
commit
2f60302843
  1. 38
      navigator/components/shell/src/ShellService.jsm
  2. 2
      platform

38
navigator/components/shell/src/ShellService.jsm

@ -6,10 +6,8 @@
this.EXPORTED_SYMBOLS = ["ShellService"];
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
"resource://gre/modules/WindowsRegistry.jsm");
@ -26,9 +24,9 @@ var ShellServiceInternal = {
*/
get canSetDesktopBackground() {
#ifdef XP_LINUX
if (this.shellService) {
let linuxShellService = this.shellService
.QueryInterface(Ci.nsIGNOMEShellService);
if (this.nsIShellService) {
let linuxShellService = this.nsIShellService
.QueryInterface(Components.interfaces.nsIGNOMEShellService);
return linuxShellService.canSetDesktopBackground;
}
#elif defined(XP_WIN) || defined(XP_MACOSX)
@ -52,16 +50,16 @@ var ShellServiceInternal = {
return false;
}
if (!Services.prefs.getBoolPref("browser.shell.checkDefaultBrowser")) {
if (!Services.prefs.getBoolPref("browser.shell.checkDefaultBrowser", false)) {
return false;
}
#ifdef XP_WIN
let optOutValue = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
"Software\\Mozilla\\Borealis",
let optOutValue = WindowsRegistry.readRegKey(Components.interfaces.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
"Software\\Binary Outcast\\Borealis",
"DefaultBrowserOptOut");
WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
"Software\\Mozilla\\Borealis",
WindowsRegistry.removeRegKey(Components.interfaces.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
"Software\\Binary Outcast\\Borealis",
"DefaultBrowserOptOut");
if (optOutValue == "True") {
Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false);
@ -83,15 +81,17 @@ var ShellServiceInternal = {
if (startupCheck) {
this._checkedThisSession = true;
}
if (this.shellService) {
return this.shellService.isDefaultBrowser(startupCheck, forAllTypes);
if (this.nsIShellService) {
return this.nsIShellService.isDefaultBrowser(startupCheck, forAllTypes);
}
return false;
}
};
XPCOMUtils.defineLazyServiceGetter(ShellServiceInternal, "shellService",
"@mozilla.org/browser/shell-service;1", Ci.nsIShellService);
XPCOMUtils.defineLazyServiceGetter(ShellServiceInternal,
"nsIShellService",
"@binaryoutcast.com/navigator/shell-service;1",
Components.interfaces.nsIShellService);
/**
* The external API exported by this module.
@ -101,10 +101,10 @@ this.ShellService = new Proxy(ShellServiceInternal, {
if (name in target) {
return target[name];
}
if (target.shellService) {
return target.shellService[name];
if (target.nsIShellService) {
return target.nsIShellService[name];
}
Services.console.logStringMessage(`${name} not found in ShellService: ${target.shellService}`);
Services.console.logStringMessage(`${name} not found in ShellService: ${target.nsIShellService}`);
return undefined;
}
});

2
platform

@ -1 +1 @@
Subproject commit 1b14edc01b2e65f8c93f0719309662b098e7131d
Subproject commit dd1ad91cb40d1f366aab1d8d552fea7155686323
Loading…
Cancel
Save