From 177db2feca2fcc45d91650f0ced8f5a0c3503700 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Tue, 23 Jan 2001 22:16:40 +0000 Subject: [PATCH] Fix for bug # 41973 (Redireted urls are not marked visited) r=rpotts sr=waterson git-svn-id: svn://10.0.0.236/trunk@85391 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 737d2fa952f..491e47414de 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2573,7 +2573,30 @@ nsDocShell::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest, EndPageLoad(aProgress, channel, aStatus); } } + else if ((aStateFlags & STATE_IS_DOCUMENT) && (aStateFlags & STATE_REDIRECTING)) { + // XXX Is it enough if I check just for the above 2 flags for redirection + nsCOMPtr webProgress(do_QueryInterface(mLoadCookie)); + // Is the document stop notification for this document? + if (aProgress == webProgress.get()) { + nsCOMPtr channel(do_QueryInterface(aRequest)); + if (channel) { + // Get the uri from the channel + nsCOMPtr uri; + channel->GetURI(getter_AddRefs(uri)); + // Add the original url to global History so that + // visited url color changes happen. + if (uri) { + // Update Global history if necessary... + PRBool updateHistory = PR_FALSE; + ShouldAddToGlobalHistory(uri, &updateHistory); + if(updateHistory) { + AddToGlobalHistory(uri); + } + } // uri + } // channel + } // aProgress + } return NS_OK; }