From 59c12cbc54ece7be839a6a6675e5e3b275d7d9e6 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Thu, 14 Sep 2000 14:49:30 +0000 Subject: [PATCH] bug 51338, cookie nag box for foreign cookies is not modal, r=valeski --- extensions/cookie/nsCookieHTTPNotify.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/extensions/cookie/nsCookieHTTPNotify.cpp b/extensions/cookie/nsCookieHTTPNotify.cpp index 634ba9d14426..afcd626b913f 100644 --- a/extensions/cookie/nsCookieHTTPNotify.cpp +++ b/extensions/cookie/nsCookieHTTPNotify.cpp @@ -220,19 +220,11 @@ nsCookieHTTPNotify::AsyncExamineResponse(nsISupports *aContext) nsCOMPtr pLoadGroup; rv = pHTTPConnection->GetLoadGroup(getter_AddRefs(pLoadGroup)); if (NS_FAILED(rv)) return rv; - nsCOMPtr pChannel; if (pLoadGroup) { rv = pLoadGroup->GetDefaultLoadChannel(getter_AddRefs(pChannel)); if (NS_FAILED(rv)) return rv; } - - nsCOMPtr pInterfaces; - nsCOMPtr pPrompter; - pHTTPConnection->GetNotificationCallbacks(getter_AddRefs(pInterfaces)); - if (pInterfaces) - pInterfaces->GetInterface(NS_GET_IID(nsIPrompt), getter_AddRefs(pPrompter)); - nsCOMPtr pFirstURL; if (pChannel) { rv = pChannel->GetURI(getter_AddRefs(pFirstURL)); @@ -241,6 +233,17 @@ nsCookieHTTPNotify::AsyncExamineResponse(nsISupports *aContext) } if (NS_FAILED(rv)) return rv; + // Get the prompter + nsCOMPtr pInterfaces; + nsCOMPtr pPrompter; + if (pChannel) { + pChannel->GetNotificationCallbacks(getter_AddRefs(pInterfaces)); + } else { + pHTTPConnection->GetNotificationCallbacks(getter_AddRefs(pInterfaces)); + } + if (pInterfaces) + pInterfaces->GetInterface(NS_GET_IID(nsIPrompt), getter_AddRefs(pPrompter)); + // Get the expires nsXPIDLCString expiresHeader; rv = pHTTPConnection->GetResponseHeader(mExpiresHeader, getter_Copies(expiresHeader));