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);"/>
+
+
+
+
diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml
index ab7e8ca7f58..e348fe96d6f 100644
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -271,7 +271,8 @@
-
+
+
+
+
+
+
diff --git a/browser/themes/gnomestripe/browser/browser.css b/browser/themes/gnomestripe/browser/browser.css
index 20ab1a754f1..9798e3132c1 100644
--- a/browser/themes/gnomestripe/browser/browser.css
+++ b/browser/themes/gnomestripe/browser/browser.css
@@ -540,6 +540,10 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
direction: ltr !important;
}
+#PopupAutoCompleteRichResult {
+ direction: ltr !important;
+}
+
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
direction: rtl;
}
@@ -730,23 +734,37 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
}
#treecolAutoCompleteImage {
- max-width : 36px;
+ max-width : 36px;
}
+.ac-result-type-bookmark,
.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/pageStarred.png");
width: 16px;
height: 16px;
}
+.ac-result-type-tag,
.autocomplete-treebody::-moz-tree-image(tag, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/tag.png");
width: 16px;
height: 16px;
}
+.ac-comment {
+ font-size: larger;
+}
+
+.ac-url-text {
+ color: #336633;
+}
+
.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: #555566;
+ color: GrayText;
+}
+
+.ac-comment[selected="true"], .ac-url-text[selected="true"] {
+ color: inherit !important;
}
.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css
index 0395b627724..f15da7bc99f 100755
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -873,6 +873,12 @@ toolbar[iconsize="small"] #paste-button:hover:active {
display: none;
}
+/* Keep the URL bar LTR */
+
+#PopupAutoCompleteRichResult {
+ direction: ltr !important;
+}
+
/* ----- PAGE PROXY ICON ----- */
#page-proxy-deck,
@@ -916,23 +922,37 @@ statusbarpanel#statusbar-display {
}
#treecolAutoCompleteImage {
- max-width : 36px;
+ max-width: 36px;
}
+.ac-result-type-bookmark,
.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/pageStarred.png");
width: 16px;
height: 16px;
}
+.ac-result-type-tag,
.autocomplete-treebody::-moz-tree-image(tag, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/tag.png");
width: 16px;
height: 16px;
}
+.ac-comment {
+ font-size: larger;
+}
+
+.ac-url-text {
+ color: #336633;
+}
+
.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: #555566;
+ color: GrayText;
+}
+
+.ac-comment[selected="true"], .ac-url-text[selected="true"] {
+ color: inherit !important;
}
.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css
index 384f88e669c..022ddd321f1 100644
--- a/browser/themes/winstripe/browser/browser.css
+++ b/browser/themes/winstripe/browser/browser.css
@@ -899,6 +899,10 @@ toolbar[iconsize="small"] #paste-button:not([disabled="true"]):hover:active {
direction: ltr;
}
+#PopupAutoCompleteRichResult {
+ direction: ltr !important;
+}
+
/* ::::: page proxy icon ::::: */
#page-proxy-deck,
@@ -941,23 +945,37 @@ statusbarpanel#statusbar-display {
}
#treecolAutoCompleteImage {
- max-width : 36px;
+ max-width: 36px;
}
+.ac-result-type-bookmark,
.autocomplete-treebody::-moz-tree-image(bookmark, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/pageStarred.png");
- width: 16px;
+ width: 16px;
height: 16px;
}
+.ac-result-type-tag,
.autocomplete-treebody::-moz-tree-image(tag, treecolAutoCompleteImage) {
list-style-image: url("chrome://browser/skin/places/tag.png");
- width: 16px;
+ width: 16px;
height: 16px;
}
+.ac-comment {
+ font-size: larger;
+}
+
+.ac-url-text {
+ color: #336633;
+}
+
.autocomplete-treebody::-moz-tree-cell-text(treecolAutoCompleteComment) {
- color: #555566;
+ color: GrayText;
+}
+
+.ac-comment[selected="true"], .ac-url-text[selected="true"] {
+ color: inherit !important;
}
.autocomplete-treebody::-moz-tree-cell-text(suggesthint, treecolAutoCompleteComment),
diff --git a/toolkit/components/autocomplete/public/nsIAutoCompleteController.idl b/toolkit/components/autocomplete/public/nsIAutoCompleteController.idl
index dabf7259867..6a68ece1ad1 100644
--- a/toolkit/components/autocomplete/public/nsIAutoCompleteController.idl
+++ b/toolkit/components/autocomplete/public/nsIAutoCompleteController.idl
@@ -41,7 +41,7 @@
interface nsIAutoCompleteInput;
-[scriptable, uuid(bb4d04f6-997b-437a-9216-7a3dbbd848d0)]
+[scriptable, uuid(b8883380-8cb3-444b-b929-0872b1cb7e73)]
interface nsIAutoCompleteController : nsISupports
{
/*
@@ -148,7 +148,7 @@ interface nsIAutoCompleteController : nsISupports
AString getImageAt(in long index);
/*
- * Set the current search string, but don't start searching
+ * Get / set the current search string. Note, setting will not start searching
*/
- void setSearchString(in AString aSearchString);
+ attribute AString searchString;
};
diff --git a/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
index 5dd90593296..9475a1d2720 100644
--- a/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/src/nsAutoCompleteController.cpp
@@ -622,10 +622,17 @@ NS_IMETHODIMP
nsAutoCompleteController::SetSearchString(const nsAString &aSearchString)
{
mSearchString = aSearchString;
-
return NS_OK;
}
+NS_IMETHODIMP
+nsAutoCompleteController::GetSearchString(nsAString &aSearchString)
+{
+ aSearchString = mSearchString;
+ return NS_OK;
+}
+
+
////////////////////////////////////////////////////////////////////////
//// nsIAutoCompleteObserver
diff --git a/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp b/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp
index 505ed71df0e..4ff54e6be08 100644
--- a/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp
+++ b/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp
@@ -350,9 +350,12 @@ nsNavHistory::StartSearch(const nsAString & aSearchString,
nsAutoString title;
aPreviousResult->GetCommentAt(i, title);
- PRBool isMatch = CaseInsensitiveFindInReadable(mCurrentSearchString, url);
+ // assuming that people learn to use the urlbar for titles (and not urls)
+ // we should search in titles first, to potentially save the second call to
+ // CaseInsensitiveFindInReadable() for the url
+ PRBool isMatch = CaseInsensitiveFindInReadable(mCurrentSearchString, title);
if (!isMatch)
- isMatch = CaseInsensitiveFindInReadable(mCurrentSearchString, title);
+ isMatch = CaseInsensitiveFindInReadable(mCurrentSearchString, url);
if (isMatch) {
nsAutoString image;
diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml
index c26d007da2e..3322c6c0897 100644
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -67,7 +67,7 @@
-
+
@@ -81,7 +81,7 @@
false
null
false
-
+
document.getAnonymousElementByAttribute(this, "anonid", "input");
@@ -120,7 +120,7 @@
popup.mInput = this;
popup;
]]>
-
+
-
- 14
-
+ 14
+
+ onget="return true;" />
-
+
@@ -354,7 +354,7 @@
this.mController.startSearch("");
]]>
-
+
-
+
+
-