the 'url has changed' alert in OnStopRequest now asks the channel for an nsIPrompt before defaulting to nsNetSupportDialog. bugs 25684,44171. r=rjc@netscape.com

git-svn-id: svn://10.0.0.236/trunk@235684 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
danm%netscape.com 2007-09-12 17:48:09 +00:00
parent 2d2f5921d1
commit 87f307a9ea

View File

@ -2653,8 +2653,16 @@ nsBookmarksService::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
// show an alert?
if (schedule.Find(NS_ConvertASCIItoUCS2("alert"), PR_TRUE, 0) >= 0)
{
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &rv);
if (NS_SUCCEEDED(rv))
nsCOMPtr<nsIInterfaceRequestor> interfaces;
nsCOMPtr<nsIPrompt> prompter;
channel->GetNotificationCallbacks(getter_AddRefs(interfaces));
if (interfaces)
interfaces->GetInterface(NS_GET_IID(nsIPrompt), getter_AddRefs(prompter));
if (!prompter)
prompter = do_GetService(kNetSupportDialogCID);
if (prompter)
{
nsAutoString promptStr;
getLocaleString("WebPageUpdated", promptStr);
@ -2696,7 +2704,7 @@ nsBookmarksService::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsAutoString stopOption;
getLocaleString("WebPageAskStopOption", stopOption);
PRBool stopCheckingFlag = PR_FALSE;
rv = dialog->ConfirmCheck(nsnull, promptStr.GetUnicode(), stopOption.GetUnicode(),
rv = prompter->ConfirmCheck(nsnull, promptStr.GetUnicode(), stopOption.GetUnicode(),
&stopCheckingFlag, &openURLFlag);
if (NS_FAILED(rv))
{