From 11bba423ac18b08374a671da395679ad7e5decb6 Mon Sep 17 00:00:00 2001 From: "sspitzer@mozilla.org" Date: Thu, 29 Nov 2007 20:57:57 -0800 Subject: [PATCH] fix for bug #399664: In location bar auto-complete, indicate which part of the result matches the query fix for bug #403159: Switch location bar auto-complete to a two line view fix for bug #399281: Transition location bar auto-complete results to a richlistbox widget r=gavin, with additional reviews from neil deakin a=firefox-3-+ sheriff approval from dietrich to check in on orange --- browser/app/profile/firefox.js | 5 + browser/base/content/browser.css | 4 + browser/base/content/browser.js | 8 + browser/base/content/browser.xul | 4 + browser/base/content/urlbarBindings.xml | 79 +- .../themes/gnomestripe/browser/browser.css | 22 +- browser/themes/pinstripe/browser/browser.css | 24 +- browser/themes/winstripe/browser/browser.css | 26 +- .../public/nsIAutoCompleteController.idl | 6 +- .../src/nsAutoCompleteController.cpp | 9 +- .../places/src/nsNavHistoryAutoComplete.cpp | 7 +- toolkit/content/widgets/autocomplete.xml | 729 +++++++++++++++--- toolkit/content/xul.css | 13 + .../themes/pinstripe/global/autocomplete.css | 58 ++ .../themes/winstripe/global/autocomplete.css | 58 ++ 15 files changed, 899 insertions(+), 153 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index dd3f0ff0cde..7592a9b3a79 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -203,6 +203,11 @@ pref("browser.urlbar.doubleClickSelectsAll", false); pref("browser.urlbar.autoFill", false); pref("browser.urlbar.matchOnlyTyped", false); +// if false, will use one-line-per-result for urlbar autocomplete +pref("browser.urlbar.richResults", true); +// the maximum number of results to show in autocomplete when doing richResults +pref("browser.urlbar.maxRichResults", 25); + pref("browser.download.useDownloadDir", true); pref("browser.download.folderList", 0); pref("browser.download.manager.showAlertOnComplete", true); diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index d34bcce9122..08934dbbeb4 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -11,6 +11,10 @@ searchbar { -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-result-popup"); } +#PopupAutoCompleteRichResult { + -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup"); +} + /* ::::: print preview toolbar ::::: */ toolbar[printpreview="true"] { -moz-binding: url("chrome://global/content/printPreviewBindings.xml#printpreviewtoolbar"); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f0102075e1f..e429819970b 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -890,6 +890,14 @@ function delayedStartup() gURLBar.setAttribute("enablehistory", "false"); } + if (gURLBar) { + try { + if (gPrefService.getBoolPref("browser.urlbar.richResults")) + gURLBar.setAttribute("autocompletepopup", "PopupAutoCompleteRichResult"); + } catch (ex) { + } + } + gBrowser.addEventListener("pageshow", function(evt) { setTimeout(pageShowEventHandlers, 0, evt); }, true); window.addEventListener("keypress", ctrlNumberTabSelection, false); diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 4309602e00a..c38d6265ff8 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -99,8 +99,12 @@ onclick="checkForMiddleClick(this, event);"/> +