Bug 234030 this makes docshell use the correct default value for prefs if they don't exist

r=peterv sr=bzbarsky a=chofman
This commit is contained in:
cbiesinger%web.de 2004-02-12 18:49:15 +00:00
Родитель c6c5a949ab
Коммит 35fa66391e
1 изменённых файлов: 16 добавлений и 11 удалений

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

@ -2998,23 +2998,28 @@ nsDocShell::Create()
// i don't want to read this pref in every time we load a url
// so read it in once here and be done with it...
mPrefs->GetBoolPref("network.protocols.useSystemDefaults",
&tmpbool);
mUseExternalProtocolHandler = tmpbool;
rv = mPrefs->GetBoolPref("network.protocols.useSystemDefaults",
&tmpbool);
if (NS_SUCCEEDED(rv))
mUseExternalProtocolHandler = tmpbool;
mPrefs->GetBoolPref("browser.block.target_new_window", &tmpbool);
mDisallowPopupWindows = tmpbool;
rv = mPrefs->GetBoolPref("browser.block.target_new_window", &tmpbool);
if (NS_SUCCEEDED(rv))
mDisallowPopupWindows = tmpbool;
mPrefs->GetBoolPref("browser.frames.enabled", &tmpbool);
mAllowSubframes = tmpbool;
rv = mPrefs->GetBoolPref("browser.frames.enabled", &tmpbool);
if (NS_SUCCEEDED(rv))
mAllowSubframes = tmpbool;
// Check pref to see if we should prevent frameset spoofing
mPrefs->GetBoolPref("browser.frame.validate_origin", &tmpbool);
mValidateOrigin = tmpbool;
rv = mPrefs->GetBoolPref("browser.frame.validate_origin", &tmpbool);
if (NS_SUCCEEDED(rv))
mValidateOrigin = tmpbool;
// Should we use XUL error pages instead of alerts if possible?
mPrefs->GetBoolPref("browser.xul.error_pages.enabled", &tmpbool);
mUseErrorPages = tmpbool;
rv = mPrefs->GetBoolPref("browser.xul.error_pages.enabled", &tmpbool);
if (NS_SUCCEEDED(rv))
mUseErrorPages = tmpbool;
return NS_OK;
}