Bug 333582 - "Specify xulrunner app main window chrome flags with a pref". Patch by Daniel Glazman <daniel@glazman.org>. r=bsmedberg, a=beltzner.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@209185 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bent.mozilla%gmail.com
2006-09-05 17:16:24 +00:00
parent 9d24616ad6
commit f2e4975401

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 = {
@@ -94,10 +97,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) { }
},