Bug 375861 - nsAppshellService shouldn't default to a hiddenWindow url that might not existfirst-r=benjamin@smedbergs.us (Benjamin Smedberg)second-r=neil@httl.net (Neil Rashbrook)
authorgijskruitbosch@gmail.com
Fri, 20 Apr 2007 14:23:35 -0700
changeset 679 bd13f8feef65b8f025980d445c97c76ed0f24564
parent 678 1691d10c93f5559130a5c0aa312148de4d38e09e
child 680 9540f037b7a998f6f72c7dad3133db2c72e438c7
push idunknown
push userunknown
push dateunknown
bugs375861
milestone1.9a4pre
Bug 375861 - nsAppshellService shouldn't default to a hiddenWindow url that might not existfirst-r=benjamin@smedbergs.us (Benjamin Smedberg)second-r=neil@httl.net (Neil Rashbrook)
xpfe/appshell/src/nsAppShellService.cpp
--- a/xpfe/appshell/src/nsAppShellService.cpp
+++ b/xpfe/appshell/src/nsAppShellService.cpp
@@ -72,16 +72,19 @@
 #include "jsapi.h"
 
 #include "nsAppShellService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIPlatformCharset.h"
 #include "nsICharsetConverterManager.h"
 #include "nsIUnicodeDecoder.h"
 
+// Default URL for the hidden window, can be overridden by a pref on Mac
+#define DEFAULT_HIDDENWINDOW_URL "resource://gre/res/hiddenWindow.html"
+
 class nsIAppShell;
 
 nsAppShellService::nsAppShellService() : 
   mXPCOMShuttingDown(PR_FALSE),
   mModalWindowCount(0)
 {
   nsCOMPtr<nsIObserverService> obs
     (do_GetService("@mozilla.org/observer-service;1"));
@@ -147,26 +150,25 @@ nsresult nsAppShellService::ClearXPConne
 
 NS_IMETHODIMP
 nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell)
 {
   nsresult rv;
   PRInt32 initialHeight = 100, initialWidth = 100;
     
 #ifdef XP_MACOSX
-  static const char defaultHiddenWindowURL[] = "chrome://global/content/hiddenWindow.xul";
   PRUint32    chromeMask = 0;
   nsCOMPtr<nsIPrefBranch> prefBranch;
   nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
   prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
   nsXPIDLCString prefVal;
   rv = prefBranch->GetCharPref("browser.hiddenWindowChromeURL", getter_Copies(prefVal));
-  const char* hiddenWindowURL = prefVal.get() ? prefVal.get() : defaultHiddenWindowURL;
+  const char* hiddenWindowURL = prefVal.get() ? prefVal.get() : DEFAULT_HIDDENWINDOW_URL;
 #else
-  static const char hiddenWindowURL[] = "resource://gre/res/hiddenWindow.html";
+  static const char hiddenWindowURL[] = DEFAULT_HIDDENWINDOW_URL;
   PRUint32    chromeMask =  nsIWebBrowserChrome::CHROME_ALL;
 #endif
 
   nsCOMPtr<nsIURI> url;
   rv = NS_NewURI(getter_AddRefs(url), hiddenWindowURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsRefPtr<nsWebShellWindow> newWindow;