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
This commit is contained in:
radha%netscape.com
2001-01-23 22:16:40 +00:00
parent 73495dffa0
commit 177db2feca

View File

@@ -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<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
// Is the document stop notification for this document?
if (aProgress == webProgress.get()) {
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
if (channel) {
// Get the uri from the channel
nsCOMPtr<nsIURI> 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;
}