diff --git a/mozilla/browser/components/nsBrowserContentHandler.js b/mozilla/browser/components/nsBrowserContentHandler.js index 985d1e26c08..2dbb3d375f1 100644 --- a/mozilla/browser/components/nsBrowserContentHandler.js +++ b/mozilla/browser/components/nsBrowserContentHandler.js @@ -84,8 +84,7 @@ function needHomepageOverride(prefb) { return true; } -function openWindow(parent, url, target, features, args) -{ +function openWindow(parent, url, target, features, args) { var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(nsIWindowWatcher); @@ -98,6 +97,18 @@ function openWindow(parent, url, target, features, args) return wwatch.openWindow(parent, url, target, features, argstring); } +function openPreferences() { + var features = "chrome,titlebar,toolbar,centerscreen,dialog=no"; + var url = "chrome://browser/content/preferences/preferences.xul"; + + var win = getMostRecentWindow("Browser:Preferences"); + if (win) { + win.focus(); + } else { + openWindow(null, url, "_blank", features); + } +} + function getMostRecentWindow(aType) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(nsIWindowMediator); @@ -117,6 +128,7 @@ var nsBrowserContentHandler = { var prefb = Components.classes["@mozilla.org/preferences-service;1"] .getService(nsIPrefBranch); this.mChromeURL = prefb.getCharPref("browser.chromeURL"); + return this.mChromeURL; }, @@ -215,8 +227,19 @@ var nsBrowserContentHandler = { var chromeParam = cmdLine.handleFlagWithParam("chrome", false); if (chromeParam) { - openWindow(null, chromeParam, "_blank", - "chrome,dialog=no,all" + this.getFeatures(cmdLine), null); + + // Handle the old preference dialog URL separately (bug 285416) + if (chromeParam == "chrome://browser/content/pref/pref.xul") { + openPreferences(); + } else { + var features = "chrome,dialog=no,all" + this.getFeatures(cmdLine); + openWindow(null, chromeParam, "_blank", features, null); + } + + cmdLine.preventDefault = true; + } + if (cmdLine.handleFlag("preferences", false)) { + openPreferences(); cmdLine.preventDefault = true; } }, diff --git a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp index a17942864d7..3638a71481d 100644 --- a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp +++ b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp @@ -160,7 +160,7 @@ OpenKeyForWriting(const char* aKeyName, HKEY* aKey, PRBool aForAllUsers, PRBool // firefox.exe\DefaultIcon (default) REG_SZ ,0 // firefox.exe\shell\open\command (default) REG_SZ // firefox.exe\shell\properties (default) REG_SZ Firefox &Options -// firefox.exe\shell\properties\command(default) REG_SZ -chrome "chrome://browser/content/pref.xul" +// firefox.exe\shell\properties\command(default) REG_SZ -preferences // // - Uninstall Information // --------------------- @@ -247,7 +247,7 @@ static SETTING gSettings[] = { PATH_SUBSTITUTION | EXE_SUBSTITUTION | NON_ESSENTIAL }, { MAKE_KEY_NAME1(SMI, "%APPEXE%\\shell\\properties\\command"), "", - "%APPPATH% -chrome \"chrome://browser/content/pref/pref.xul\"", + "%APPPATH% -preferences", PATH_SUBSTITUTION | EXE_SUBSTITUTION | NON_ESSENTIAL } // The value of the menu must be set by hand, since it contains a localized