Don't try to enable global history if we were told not to. Bug 334846,

r=bsmedberg, sr=darin
This commit is contained in:
bzbarsky%mit.edu 2006-05-01 03:47:12 +00:00
Родитель 5e855c68ad
Коммит f9a8a7c8e2
2 изменённых файлов: 7 добавлений и 4 удалений

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

@ -107,6 +107,7 @@ nsWebBrowser::nsWebBrowser() : mDocShellTreeOwner(nsnull),
mInitInfo(nsnull), mInitInfo(nsnull),
mContentType(typeContentWrapper), mContentType(typeContentWrapper),
mActivating(PR_FALSE), mActivating(PR_FALSE),
mShouldEnableHistory(PR_TRUE),
mParentNativeWindow(nsnull), mParentNativeWindow(nsnull),
mProgressListener(nsnull), mProgressListener(nsnull),
mBackgroundColor(0), mBackgroundColor(0),
@ -789,6 +790,7 @@ NS_IMETHODIMP nsWebBrowser::SetProperty(PRUint32 aId, PRUint32 aValue)
NS_ENSURE_STATE(mDocShell); NS_ENSURE_STATE(mDocShell);
NS_ENSURE_TRUE((aValue == PR_TRUE || aValue == PR_FALSE), NS_ERROR_INVALID_ARG); NS_ENSURE_TRUE((aValue == PR_TRUE || aValue == PR_FALSE), NS_ERROR_INVALID_ARG);
rv = EnableGlobalHistory(aValue); rv = EnableGlobalHistory(aValue);
mShouldEnableHistory = aValue;
} }
break; break;
case nsIWebBrowserSetup::SETUP_FOCUS_DOC_BEFORE_CONTENT: case nsIWebBrowserSetup::SETUP_FOCUS_DOC_BEFORE_CONTENT:
@ -1215,9 +1217,9 @@ NS_IMETHODIMP nsWebBrowser::Create()
NS_ENSURE_TRUE(mInitInfo->sessionHistory, NS_ERROR_FAILURE); NS_ENSURE_TRUE(mInitInfo->sessionHistory, NS_ERROR_FAILURE);
mDocShellAsNav->SetSessionHistory(mInitInfo->sessionHistory); mDocShellAsNav->SetSessionHistory(mInitInfo->sessionHistory);
// Hook up global history. Do not fail if we can't - just assert. // Hook up global history. Do not fail if we can't - just warn.
nsresult rv = EnableGlobalHistory(PR_TRUE); nsresult rv = EnableGlobalHistory(mShouldEnableHistory);
NS_ASSERTION(NS_SUCCEEDED(rv), "EnableGlobalHistory() failed"); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "EnableGlobalHistory() failed");
NS_ENSURE_SUCCESS(mDocShellAsWin->Create(), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(mDocShellAsWin->Create(), NS_ERROR_FAILURE);

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

@ -164,7 +164,8 @@ protected:
nsCOMPtr<nsIWindowWatcher> mWWatch; nsCOMPtr<nsIWindowWatcher> mWWatch;
nsWebBrowserInitInfo* mInitInfo; nsWebBrowserInitInfo* mInitInfo;
PRUint32 mContentType; PRUint32 mContentType;
PRBool mActivating; PRPackedBool mActivating;
PRPackedBool mShouldEnableHistory;
nativeWindow mParentNativeWindow; nativeWindow mParentNativeWindow;
nsIWebProgressListener *mProgressListener; nsIWebProgressListener *mProgressListener;
nsCOMPtr<nsIWebProgress> mWebProgress; nsCOMPtr<nsIWebProgress> mWebProgress;