From f2e49754014e419814d4dcd0381c7317a6773a0d Mon Sep 17 00:00:00 2001 From: "bent.mozilla%gmail.com" Date: Tue, 5 Sep 2006 17:16:24 +0000 Subject: [PATCH] Bug 333582 - "Specify xulrunner app main window chrome flags with a pref". Patch by Daniel Glazman . r=bsmedberg, a=beltzner. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@209185 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/components/nsDefaultCLH.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mozilla/toolkit/components/nsDefaultCLH.js b/mozilla/toolkit/components/nsDefaultCLH.js index 3f0b5338e22..84e4423c4d2 100644 --- a/mozilla/toolkit/components/nsDefaultCLH.js +++ b/mozilla/toolkit/components/nsDefaultCLH.js @@ -20,6 +20,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): + * Daniel Glazman * * 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) { } },