Ongoing work for bug 182366. Use machine learning techniques to sort autocomplete results. r=heikki. sr=hewitt.

This commit is contained in:
nisheeth@netscape.com
2003-01-13 22:23:41 +00:00
parent da1c857b8c
commit ccb2a90e5a
7 changed files with 1249 additions and 12 deletions

View File

@@ -4186,7 +4186,7 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
// Add the original url to global History so that
// visited url color changes happen.
if (uri)
AddToGlobalHistory(uri, PR_TRUE);
AddToGlobalHistory(channel, uri, PR_TRUE);
} // channel
} // aProgress
}
@@ -5829,7 +5829,7 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIChannel * aChannel,
}
// Update Global history
AddToGlobalHistory(aURI, IsFrame());
AddToGlobalHistory(aChannel, aURI, IsFrame());
}
// If this was a history load, update the index in
@@ -6368,8 +6368,9 @@ NS_IMETHODIMP nsDocShell::MakeEditable(PRBool inWaitForUriLoad)
}
nsresult
nsDocShell::AddToGlobalHistory(nsIURI * aURI, PRBool aHidden)
nsDocShell::AddToGlobalHistory(nsIChannel* aChannel, nsIURI * aURI, PRBool aHidden)
{
nsresult rv;
// first check if we should be adding it
PRBool updateHistory;
ShouldAddToGlobalHistory(aURI, &updateHistory);
@@ -6382,6 +6383,22 @@ nsDocShell::AddToGlobalHistory(nsIURI * aURI, PRBool aHidden)
NS_ENSURE_SUCCESS(mGlobalHistory->AddPage(spec.get()), NS_ERROR_FAILURE);
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(aChannel, &rv));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIURI> referrer;
rv = httpChannel->GetReferrer(getter_AddRefs(referrer));
if (NS_SUCCEEDED(rv) && referrer) {
nsCAutoString referrerSpec;
rv = referrer->GetSpec(referrerSpec);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIBrowserHistory> browserHistory =
do_QueryInterface(mGlobalHistory);
browserHistory->OutputReferrerURL(spec.get(),
referrerSpec.get());
}
}
}
// this is a redirect, so hide the page from
// being enumerated in history
if (aHidden) {