Bug 375861 - nsAppshellService shouldn't default to a hiddenWindow url that might not exist

first-r=benjamin@smedbergs.us (Benjamin Smedberg)
second-r=neil@httl.net (Neil Rashbrook)
This commit is contained in:
gijskruitbosch%gmail.com 2007-04-20 21:23:35 +00:00
Родитель 63e73f92f3
Коммит 60832f40eb
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -77,6 +77,9 @@
#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() :
@ -152,16 +155,15 @@ nsAppShellService::CreateHiddenWindow(nsIAppShell* aAppShell)
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