From 24a7f6e5bbd403a4f8dfddab1cd55616ed87e54d Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Thu, 14 Sep 2006 06:02:51 +0000 Subject: [PATCH] 112208 - Autocomplete doesn't match against redirected urls (like amazon.com, hotmail.com). r=hewitt sr=alecf git-svn-id: svn://10.0.0.236/trunk@211075 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/browser/sessionHistoryUI.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mozilla/suite/browser/sessionHistoryUI.js b/mozilla/suite/browser/sessionHistoryUI.js index b3397786192..67612367b06 100644 --- a/mozilla/suite/browser/sessionHistoryUI.js +++ b/mozilla/suite/browser/sessionHistoryUI.js @@ -41,6 +41,8 @@ const MAX_HISTORY_MENU_ITEMS = 15; const MAX_HISTORY_ITEMS = 100; var gRDF = null; var gRDFC = null; +var gGlobalHistory = null; +var gURIFixup = null; var gLocalStore = null; function FillHistoryMenu(aParent, aMenu) @@ -164,6 +166,13 @@ function addToUrlbarHistory() gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"] .getService(Components.interfaces.nsIRDFService); + if (!gGlobalHistory) + gGlobalHistory = Components.classes["@mozilla.org/browser/global-history;1"] + .getService(Components.interfaces.nsIBrowserHistory); + + if (!gURIFixup) + gURIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"] + .getService(Components.interfaces.nsIURIFixup); if (!gLocalStore) gLocalStore = gRDF.GetDataSource("rdf:local-store"); @@ -248,6 +257,8 @@ function addToUrlbarHistory() // Otherwise, we've got a new URL in town. Add it! // Put the value as it was typed by the user in to RDF // Insert it to the beginning of the list. + var fixedUpURI = gURIFixup.createFixupURI(entryToAdd.Value, 0); + gGlobalHistory.markPageAsTyped(fixedUpURI.spec); entries.InsertElementAt(entryToAdd, 1, true); // Remove any expired history items so that we don't let