Revert nsIGlobalHistory2 to what it was on the 1.8 branch. Move the new stuff

to nsIGlobalHistory3.  Bug 328928, r=brettw and smfr, sr=darin
This commit is contained in:
bzbarsky@mit.edu
2006-03-03 03:34:48 +00:00
parent 758700f50b
commit a66006818c
10 changed files with 117 additions and 72 deletions

View File

@@ -4683,14 +4683,18 @@ nsDocShell::OnRedirectStateChange(nsIChannel* aOldChannel,
return; // not a toplevel document
nsCOMPtr<nsIGlobalHistory3> history3(do_QueryInterface(mGlobalHistory));
nsresult result = NS_ERROR_NOT_IMPLEMENTED;
if (history3) {
// notify global history of this redirect
history3->AddToplevelRedirect(aOldChannel, aNewChannel,
aRedirectFlags);
} else {
// when there is no GlobalHistory3, we fall back to GlobalHistory2.
// Just notify that the redirecting page was a redirect so it will
// be link colored but not visible.
result = history3->AddDocumentRedirect(aOldChannel, aNewChannel,
aRedirectFlags, !IsFrame());
}
if (result == NS_ERROR_NOT_IMPLEMENTED) {
// when there is no GlobalHistory3, or it doesn't implement
// AddToplevelRedirect, we fall back to GlobalHistory2. Just notify
// that the redirecting page was a redirect so it will be link colored
// but not visible.
nsCOMPtr<nsIURI> oldURI;
aOldChannel->GetURI(getter_AddRefs(oldURI));
if (! oldURI)