Fix bug 64412: security warning dialogs must be dismissed twice. r=pollman, a=ben

This commit is contained in:
disttsc%bart.nl 2001-01-13 06:42:16 +00:00
parent 79ff2227f2
commit 879801f0ef
2 changed files with 16 additions and 3 deletions

View File

@ -465,12 +465,13 @@ nsBrowserInstance::~nsBrowserInstance()
}
void
nsBrowserInstance::ReinitializeContentVariables()
nsBrowserInstance::ReinitializeContentWindow()
{
nsresult rv;
nsCOMPtr<nsIDOMWindowInternal> contentWindow;
mDOMWindow->Get_content(getter_AddRefs(contentWindow));
nsCOMPtr<nsIScriptGlobalObject> globalObj(do_QueryInterface(contentWindow));
if (globalObj) {
@ -528,9 +529,17 @@ nsBrowserInstance::ReinitializeContentVariables()
mUrlbarHistory = ubHistory;
}
}
}
void
nsBrowserInstance::ReinitializeContentVariables()
{
ReinitializeContentWindow();
nsresult rv;
/* reinitialize the security module */
nsCOMPtr<nsSecureBrowserUI> security = do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv);
nsCOMPtr<nsSecureBrowserUI> security(do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv) && security) {
nsCOMPtr<nsIDOMDocument> doc;
rv = mDOMWindow->GetDocument(getter_AddRefs(doc));
@ -538,6 +547,9 @@ nsBrowserInstance::ReinitializeContentVariables()
nsCOMPtr<nsIDOMElement> button;
rv = doc->GetElementById(NS_LITERAL_STRING("security-button"), getter_AddRefs(button));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDOMWindowInternal> contentWindow;
mDOMWindow->Get_content(getter_AddRefs(contentWindow));
security->Init(contentWindow, button);
}
}
@ -798,7 +810,7 @@ nsBrowserInstance::SetWebShellWindow(nsIDOMWindowInternal* aWin)
}
}
ReinitializeContentVariables();
ReinitializeContentWindow();
return NS_OK;
}

View File

@ -92,6 +92,7 @@ class nsBrowserInstance : public nsIBrowserInstance,
nsresult GetFocussedContentWindow(nsIDOMWindowInternal** outFocussedWindow);
void ReinitializeContentWindow();
void ReinitializeContentVariables();
nsresult InitializeSearch(nsIDOMWindowInternal* windowToSearch, nsIFindComponent *finder );