New preference "toolkit.defaultChromeFeatures" to override the default features of xulrunner-based main window; b=333582, r=benjamin@smedberg.us

git-svn-id: svn://10.0.0.236/trunk@194127 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
daniel%glazman.org 2006-04-11 15:03:27 +00:00
parent 6d219d5d97
commit 40893927b9

View File

@ -20,6 +20,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Daniel Glazman <daniel.glazman@disruptive-innovations.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -51,9 +52,11 @@ const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
* This file provides a generic default command-line handler.
*
* It opens the chrome window specified by the pref "toolkit.defaultChromeURI"
* the arguments passed to the window are the nsICommandLine instance.
* with the flags specified by the pref "toolkit.defaultChromeFlags"
* or "chrome,dialog=no,all" is it is not available.
* The arguments passed to the window are the nsICommandLine instance.
*
* It doesn't do anything if the pref is unset.
* It doesn't do anything if the pref "toolkit.defaultChromeURI" is unset.
*/
var nsDefaultCLH = {
@ -97,10 +100,16 @@ var nsDefaultCLH = {
try {
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
var flags = "chrome,dialog=no,all";
try {
flags = prefs.getCharPref("toolkit.defaultChromeFeatures");
}
catch (e) { }
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(nsIWindowWatcher);
wwatch.openWindow(null, chromeURI, "_blank",
"chrome,dialog=no,all", cmdLine);
flags, cmdLine);
}
catch (e) { }
},