Bug 452080, improve autocomplete to always show results when open and display 4 search engines, r=mfinkle
authorNeil Deakin <neil@mozilla.com>
Sat, 13 Sep 2008 17:11:48 -0400
changeset 64827 e353515655eeb36698631cc87c53921a92af8e56
parent 64826 6d69477fd360e47d4f833d1b404e4610488165a0
child 64828 ec604e7695e623d73af827ef1f735fa8f8162674
push id19389
push userffxbld
push dateWed, 06 Apr 2011 21:33:21 +0000
treeherdermozilla-central@8e9f90073a20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs452080
Bug 452080, improve autocomplete to always show results when open and display 4 search engines, r=mfinkle
mobile/chrome/Makefile.in
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.xul
mobile/chrome/locale/en-US/searchplugins/amazondotcom.xml
mobile/chrome/locale/en-US/searchplugins/answers.xml
mobile/chrome/locale/en-US/searchplugins/creativecommons.xml
mobile/chrome/locale/en-US/searchplugins/eBay.xml
mobile/chrome/locale/en-US/searchplugins/google.xml
mobile/chrome/locale/en-US/searchplugins/list.txt
mobile/chrome/locale/en-US/searchplugins/wikipedia.xml
mobile/chrome/locale/en-US/searchplugins/yahoo.xml
mobile/chrome/skin/browser.css
--- a/mobile/chrome/Makefile.in
+++ b/mobile/chrome/Makefile.in
@@ -37,11 +37,18 @@
 
 DEPTH     = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
+vpath %.xml $(srcdir)/locale/$(MOZ_UI_LOCALE)/searchplugins
+
 DEFINES   += -DAB_CD=$(MOZ_UI_LOCALE) -DPACKAGE=browser
 
+SEARCH_PLUGINS = $(shell cat $(srcdir)/locale/$(MOZ_UI_LOCALE)/searchplugins/list.txt)
+
+libs:: $(addsuffix .xml,$(SEARCH_PLUGINS))
+	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/searchplugins
+
 include $(topsrcdir)/config/rules.mk
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -43,16 +43,17 @@ const UIMODE_NONE              = 0;
 const UIMODE_URLVIEW           = 1;
 const UIMODE_URLEDIT           = 2;
 const UIMODE_BOOKMARK          = 3;
 const UIMODE_BOOKMARKLIST      = 4;
 const UIMODE_TABS              = 5;
 const UIMODE_CONTROLS          = 6;
 const UIMODE_PANEL             = 7;
 
+const kMaxEngines = 4;
 const kDefaultFavIconURL = "chrome://browser/skin/images/default-favicon.png";
 
 var BrowserUI = {
   _panel : null,
   _caption : null,
   _edit : null,
   _throbber : null,
   _autocompleteNavbuttons : null,
@@ -321,17 +322,17 @@ var BrowserUI = {
   },
 
   _editToolbar : function(aEdit) {
     var toolbar = document.getElementById("toolbar-main");
     if (aEdit) {
       toolbar.setAttribute("mode", "edit");
       this._caption.hidden = true;
       this._edit.hidden = false;
-      this._edit.focus();
+      this._edit.inputField.focus();
     }
     else {
       toolbar.setAttribute("mode", "view");
       this._edit.hidden = true;
       this._edit.reallyClosePopup();
       this._caption.hidden = false;
     }
   },
@@ -514,33 +515,31 @@ var BrowserUI = {
 
   search : function() {
     var queryURI = "http://www.google.com/search?q=" + this._edit.value + "&hl=en&lr=&btnG=Search";
     getBrowser().loadURI(queryURI, null, null, false);
 
     this.show(UIMODE_URLVIEW);
   },
 
-  openDefaultHistory : function () {
-    if (!this._edit.value) {
-      this._autocompleteNavbuttons.hidden = true;
+  updateAutoComplete : function(showDefault)
+  {
+    this.updateSearchEngines();
+    if (showDefault || this._edit.getAttribute("nomatch"))
       this._edit.showHistoryPopup();
-    }
   },
 
   doButtonSearch : function(button)
   {
     if (!("engine" in button) || !button.engine)
       return;
 
     var urlbar = this._edit;
     urlbar.open = false;
     var value = urlbar.value;
-    if (!value)
-      return;
 
     var submission = button.engine.getSubmission(value, null);
     getBrowser().loadURI(submission.uri.spec, null, submission.postData, false);
   },
 
   engines : null,
   updateSearchEngines : function () {
     if (this.engines)
@@ -554,24 +553,25 @@ var BrowserUI = {
       this.engines = [ ];
       return;
     }
 
     var engines = searchService.getVisibleEngines({ });
     this.engines = engines;
     const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     var container = this._autocompleteNavbuttons;
-    for (var e = 0; e < engines.length; e++) {
+    for (var e = 0; e < kMaxEngines && e < engines.length; e++) {
       var button = document.createElementNS(kXULNS, "toolbarbutton");
       var engine = engines[e];
       button.id = engine.name;
       button.setAttribute("label", engine.name);
+      button.className = "searchengine";
       if (engine.iconURI)
         button.setAttribute("image", engine.iconURI.spec);
-      container.insertBefore(button, container.firstChild);
+      container.appendChild(button);
       button.engine = engine;
     }
   },
 
   mode : UIMODE_NONE,
   show : function(aMode) {
     if (this.mode == aMode)
       return;
@@ -729,23 +729,19 @@ var BrowserUI = {
         this._linkAdded(aEvent);
         break;
       case "TabSelect":
         this._tabSelect(aEvent);
         break;
       // URL textbox events
       case "click":
         this.show(UIMODE_URLEDIT);
-        this.openDefaultHistory();
         break;
       case "input":
-        if (this._edit.value) {
-          this.updateSearchEngines();
-          this._autocompleteNavbuttons.hidden = false;
-        }
+        this.updateAutoComplete(false);
         break;
       case "keypress":
         if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
           this._edit.reallyClosePopup();
           this.show(UIMODE_URLVIEW);
         }
         break;
       // Favicon events
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -199,16 +199,17 @@
                    enablehistory="false"
                    maxrows="6"
                    completeselectedindex="true"
                    minresultsforpopup="0"
                    flex="1"
                    hidden="true"
                    autocompletepopup="popup_autocomplete"
                    ontextentered="BrowserUI.goToURI();"
+                   onsearchcomplete="BrowserUI.updateAutoComplete(false);"
                    clickSelectsAll="true"/>
         </hbox>
         <hbox id="urlbar-icons">
           <toolbarbutton id="tool-reload" class="urlbar-icon-button" command="cmd_reload"/>
           <toolbarbutton id="tool-stop" class="urlbar-icon-button" command="cmd_stop"/>
           <toolbarbutton id="tool-go" class="urlbar-icon-button" command="cmd_go"/>
         </hbox>
       </hbox>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/amazondotcom.xml
@@ -0,0 +1,13 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Amazon.com</ShortName>
+<Description>Amazon.com Search</Description>
+<InputEncoding>ISO-8859-1</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHgSURBVHjalFM9TNtQEP4cB7PwM1RITUXIgsRaYEEVEyKZwhiyZAQyd0BhpFOlIjoBqhjSqVQMoVMLLAjEwECCQJkSkBqJYDOAFOMKFSf28d7DTUxiUDnp/Pzeu/vuu7t3ICKF6SLTMv2/lB0fRWKfjwDm4JJisYh0Oo3fpZLYT0SjSCQS8JAFMADNDZ3NZsnf1taiqVTKi4nGASruk5lkkmTmMB6JUKFQqO+DfX1eABWeQoVR6f7HSdM0obqu48Yw8G1tDT82NsRd1TSbU9BbGPCog8PDj+jLzurFoAVgMh4XxoNDQ6SqKi0tL9eBvAB8zZwymYxYY7EYAoEA8vm82BNTg6XUIs0MeGTZoR1mhXSnwNl4pmAbjU7mcjkKhkL1ynMnntZ4OEw3VyrV8utk7s5TdW++0QXz+1i3P7IK36t+PCfVn1OQOoOA0gXr5DPak+cPXbBK+/T3S69AtY3LJ98vZ1or/iLr+pTuvr59/A6s003UdqZFJF/PCKQ3o5CUznoBST2AfbEF/9iqYEDaIfwj73VJPEfgNTe0tWNYR0uwy9uOW0OkrgHI7z5ADo2C7v48nLV3XHKAT+x/1m1sX58xsBxg8rZJrDYD8DHHp4aJj/MK09sXjPOt46PcCzAACXY8/u34wN0AAAAASUVORK5CYII=</Image>
+<Url type="text/html" method="GET" template="http://www.amazon.com/exec/obidos/external-search/">
+  <Param name="field-keywords" value="{searchTerms}"/>
+  <Param name="mode" value="blended"/>
+  <Param name="tag" value="mozilla-20"/>
+  <Param name="sourceid" value="Mozilla-search"/>
+</Url>
+<SearchForm>http://www.amazon.com/</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/answers.xml
@@ -0,0 +1,13 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Answers.com</ShortName>
+<Description>Dictionary Search on Answers.com</Description>
+<InputEncoding>UTF-8</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////K////4f////E////5f///+n////P////mv///0EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8E////fv///+//////////////////////7NnP/+LFtv/////+////of///xYAAAAAAAAAAAAAAAD///8D////lf////////////j0//bi1v/OlXf/tGU9/6FCEv/OmH3////////////////D////FgAAAAAAAAAA////avPm4P/evaz/8NbI//7r3//23M3/xYRi/5kzAP/Df1z//u/l//749P/v4dn/+PPw/////6j///8B////GP///+W/f1//smM7//bczf/+69///uvf/9ytlP+ZMwD/5se3/+/f1//AgmP/nj0N/927qv/////+////QP///2z/////8NvQ/8WCYP/+69///uvf//7r3/+7ckz/pUkb/9m1ov+ePQ3/okUW/8+fh//38O3//////////5r///+t//////7y6v/Cflv/58Cr//DRwP/mwKv/okQU/8ODYv/cuqj/yZN4//Tq5f/+9e///vDn///////////Q////yf/////+7+b/05yA/65ZLv+9dVD/sF40/5kzAP/kvKb//vTu//Tr5v/7+Pb//vfz//707f//////////6f///8X//////vDm/+K4ov/KjGz//ure/8uNbf+jRBX/+OTX/+3b0v+jSBr/pk0h/717Wv/Wrpr//Pn4/////+b///+i//////7z7f/02Mj/wn5b//vl2P+uWS7/vXhU//v49//48u//1q6a/717Wv+oUSb/tWxH//jz8P/////K////V///////+/j//ure/8aFZP/fs5v/oEAQ/9q1o/+zaEL/1ayX//718P/+9/P/+PHu//jz8P//////////h////wr////O///////38v/YpYr/tGQ7/6ZLHf/06eX/s2dB/549Df/x49z//vDn//7x6f//////////8////yoAAAAA////R/////v/////7dXI/5kzAP+7cUv//vHp/+vYzv+bNwX/vHlY//38/P///////////////30AAAAAAAAAAAAAAAD///9n////+/z5+P++e1n/3LGc//7w5//++PT/0KKL/8OIa//9/Pv//////////5X///8GAAAAAAAAAAAAAAAAAAAAAP///0n////K///////////////////////////+/v7/////5v///2z///8CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////Cv///1f///+g////xP///8n///+r////bP///xoAAAAAAAAAAAAAAAAAAAAA+B////AH///AA///wAH//4AB//+AAP//AAD//wAA//8AAP//AAD//4AA//+AAf//wAP//+AD///wD////D///w==</Image>
+<Url type="text/html" method="GET" template="http://www.answers.com/main/ntquery">
+  <Param name="s" value="{searchTerms}"/>
+  <Param name="gwp" value="13"/>
+</Url>
+<Url type="application/x-suggestions+json" method="GET"
+     template="http://www.answers.com/main/startswith?output=json&amp;client=firefox&amp;s={searchTerms}"/>
+<SearchForm>http://www.answers.com/</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/creativecommons.xml
@@ -0,0 +1,11 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Creative Commons</ShortName>
+<Description>Find photos, movies, music, and text to rip, sample, mash, and share.</Description>
+<InputEncoding>utf-8</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAJUSURBVDiNjZO9S1thGMXPvTfJFbnkipNkLLS0ksFg0M0lf4CboNCEgIIg/RiKtEOn0qGWTtbVoBYcIji10I9J0ApWCjp0kRaXdhHjTW4+uGnur4NJ8GOwZ3nf4TnnfZ5z3scAdBGGYdyVdN+yrGHTNNOtVqsVhuG+pO+S3gE/LtV3BIxzPDJNc8FxHGN0dNRKpVIGoJ2dndr+/r5Vr9cl6bmkN0AoSQIEyHXdj5KYnZ3F932uolKpkM/nK5KQ9FmSCZwLOI7zQBLr6+vXiFdRLBaDtsiTTve3YrFYkM/nbyR3MDU1dSKpLumO+vr6Xruui+d5AFSrVVZWVtjY2KDRaABwdHTE4uIie3t7AJTLZaLRaFXSCyUSid1MJgOA53n09/eTTqdJJpPMzc2xurqKbduMj48Tj8fZ3d0FYHBw8FjSezmOU56fnwdgeXkZ27ap1WpUKhWazSZjY2Nks1kASqVSd4zp6eljSX/MtiHdRDpnEATyfb+bkiSVSqXu3TCM8xgHBga+dkY4OzvDdV2GhoZIJBLMzMxQKBSIRqNkMhlisRhbW1sAJJPJn5I+KB6Pv7poou/7rK2tsbm5SRAEXROXlpY4ODgAoFarYdu2J+llN8ZcLvffMeZyud+SGpLuCVBPT89jSRQKhRvJxWKxISmU9JTOT5Rk9Pb2fpHE5OQkJycn14inp6dMTEx4bdM/SbKAy8sk6WEkElmwLCuSSqUYGRmxgHB7e7t+eHgYazabgaRnkt7SeZnr63xbUtYwjGHTNNNhGP4F9iR9a6/zr4v1/wDE1D9XlC4rrAAAAABJRU5ErkJggg==</Image>
+<Url type="text/html" method="GET" template="http://search.creativecommons.org/">
+  <Param name="q" value="{searchTerms}"/>
+  <Param name="sourceid" value="Mozilla-search"/>
+</Url>
+<SearchForm>http://search.creativecommons.org/</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/eBay.xml
@@ -0,0 +1,17 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>eBay</ShortName>
+<Description>eBay - Online actions</Description>
+<InputEncoding>ISO-8859-1</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAADAAAAA/wAAAABAAABAQAAAgEAAAMBAAAD/QAAAAIAAAECAAACAgAAAwIAAAP+AAAAAwAAAQMAAAIDAAADAwAAA/8AAAAD/AABA/wAAgP8AAMD/AAD//wAAAABAAEAAQACAAEAAwABAAP8AQAAAQEAAQEBAAIBAQADAQEAA/0BAAACAQABAgEAAgIBAAMCAQAD/gEAAAMBAAEDAQACAwEAAwMBAAP/AQAAA/0AAQP9AAID/QADA/0AA//9AAAAAgABAAIAAgACAAMAAgAD/AIAAAECAAEBAgACAQIAAwECAAP9AgAAAgIAAQICAAICAgADAgIAA/4CAAADAgABAwIAAgMCAAMDAgAD/wIAAAP+AAED/gACA/4AAwP+AAP//gAAAAMAAQADAAIAAwADAAMAA/wDAAABAwABAQMAAgEDAAMBAwAD/QMAAAIDAAECAwACAgMAAwIDAAP+AwAAAwMAAQMDAAIDAwADAwMAA/8DAAAD/wABA/8AAgP/AAMD/wAD//8AAAAD/AEAA/wCAAP8AwAD/AP8A/wAAQP8AQED/AIBA/wDAQP8A/0D/AACA/wBAgP8AgID/AMCA/wD/gP8AAMD/AEDA/wCAwP8AwMD/AP/A/wAA//8AQP//AID//wDA//8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB8fHx8fHx8fHx8fHx8AAB8cGRkUFAcHBx8fBUKfAAAfFBkfHxNHF4cb29vCnwAAHxkZFBQUBx8HG98bwp8fAB8ZGR8UGQcXhxvb28KFXx8fHZkZGRNHBwcfG8jCgoQfAB8fHx8HBx8b29vCnwPCnwAAAB8fBwcfHx8EBB8Dwp8AAAAAHx8fHwAfHx8AHx8fAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AAD//wAA//8AAP//AACAAwAAAAMAAAADAAAAAQAAAAAAAAAAAACAAAAA4AAAAPCIAAD//wAA//8AAP//AAA=</Image>
+<Url type="text/html" method="GET" template="http://search.ebay.com/search/search.dll">
+  <Param name="query" value="{searchTerms}"/>
+  <Param name="MfcISAPICommand" value="GetResult"/>
+  <Param name="ht" value="1"/>
+  <Param name="ebaytag1" value="ebayreg"/>
+  <Param name="srchdesc" value="n"/>
+  <Param name="maxRecordsReturned" value="300"/>
+  <Param name="maxRecordsPerPage" value="50"/>
+  <Param name="SortProperty" value="MetaEndSort"/>
+</Url>
+<SearchForm>http://search.ebay.com/</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/google.xml
@@ -0,0 +1,17 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Google</ShortName>
+<Description>Google Search</Description>
+<InputEncoding>UTF-8</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAaRJREFUeNpiVIg5JRURw0A0YAHio943kYV%2B%2Ff33%2BdvvX7%2F%2FMjEx8nKycrGzwKXOiPKzICvdeezLhCV3jp15%2Bfv%2FX0YGhv8MDDxMX2qKTIw0RK10eYD6QYqATvoPBkt3f5K0W9Ew4fjTFz%2F%2Bw8Dm3W8UPeZxqFa%2BevsFyD0twgfVsOfkRxHrtfV9u5BVQ8Crd98%2FffkGYQM1QJ20%2FfSPv79eNxQGYfpSVJADmcvEAHbr7oOX2dj%2FERNKIA2%2F%2F%2Fz%2FxfCDhYVoDUDw5P6vf9%2B5iY0HVmZGQWm%2BN3fff%2Fn2k4eLHS739x%2FDiRs%2Ff%2F%2F5x8HO%2FOHzN3djfqgNjIwMgc6qzLx%2Fpy47j2zY%2Feff06tXhOUucgxeun33AUZGpHh4%2Bvo7t8EyIJqz%2FhpasD59%2B5dNrqdnznZIsEL9ICXCsWuBCwvTv%2FymS5PWPP32ExEALz%2F%2BB5r848cPCJcRaMP9xaYQzofPPzfuvrnj0Jst%2B5%2F8%2Bc4sLPeDkYlRgJc93VPE18NIXkYUmJYQSQMZ%2FP3379uPH7%2F%2F%2FEETBzqJ0WqLGvFpe2LCC4AAAwAyjg7ENzDDWAAAAABJRU5ErkJggg%3D%3D</Image>
+<Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;client=firefox&amp;hl={moz:locale}&amp;q={searchTerms}"/>
+<Url type="text/html" method="GET" template="http://www.google.com/search">
+  <Param name="q" value="{searchTerms}"/>
+  <Param name="ie" value="utf-8"/>
+  <Param name="oe" value="utf-8"/>
+  <Param name="aq" value="t"/>
+  <!-- Dynamic parameters -->
+  <Param name="rls" value="{moz:distributionID}:{moz:locale}:{moz:official}"/>
+  <MozParam name="client" condition="defaultEngine" trueValue="firefox-a" falseValue="firefox"/>
+</Url>
+<SearchForm>http://www.google.com/firefox</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/list.txt
@@ -0,0 +1,7 @@
+amazondotcom
+answers
+creativecommons
+eBay
+google
+wikipedia
+yahoo
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/wikipedia.xml
@@ -0,0 +1,15 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Wikipedia (en)</ShortName>
+<Description>Wikipedia, the free encyclopedia</Description>
+<InputEncoding>UTF-8</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAEAgQAhIOEAMjHyABIR0gA6ejpAGlqaQCpqKkAKCgoAPz9%2FAAZGBkAmJiYANjZ2ABXWFcAent6ALm6uQA8OjwAiIiIiIiIiIiIiI4oiL6IiIiIgzuIV4iIiIhndo53KIiIiB%2FWvXoYiIiIfEZfWBSIiIEGi%2FfoqoiIgzuL84i9iIjpGIoMiEHoiMkos3FojmiLlUipYliEWIF%2BiDe0GoRa7D6GPbjcu1yIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</Image>
+<Url type="application/x-suggestions+json" method="GET" template="http://en.wikipedia.org/w/api.php">
+  <Param name="action" value="opensearch"/>
+  <Param name="search" value="{searchTerms}"/>
+</Url>
+<Url type="text/html" method="GET" template="http://en.wikipedia.org/wiki/Special:Search">
+  <Param name="search" value="{searchTerms}"/>
+  <Param name="sourceid" value="Mozilla-search"/>
+</Url>
+<SearchForm>http://en.wikipedia.org/wiki/Special:Search</SearchForm>
+</SearchPlugin>
new file mode 100644
--- /dev/null
+++ b/mobile/chrome/locale/en-US/searchplugins/yahoo.xml
@@ -0,0 +1,14 @@
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>Yahoo</ShortName>
+<Description>Yahoo Search</Description>
+<InputEncoding>UTF-8</InputEncoding>
+<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==</Image>
+<Url type="application/x-suggestions+json" method="GET"
+     template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchTerms}" />
+<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
+  <Param name="p" value="{searchTerms}"/>
+  <Param name="ei" value="UTF-8"/>
+  <MozParam name="fr" condition="pref" pref="yahoo-fr" />
+</Url>
+<SearchForm>http://search.yahoo.com/</SearchForm>
+</SearchPlugin>
--- a/mobile/chrome/skin/browser.css
+++ b/mobile/chrome/skin/browser.css
@@ -71,17 +71,17 @@ toolbarbutton {
   -moz-appearance: none !important;
   -moz-box-orient: vertical;
   min-width: 0px;
   padding: 5px !important;
   margin: 0px !important;
   -moz-margin-end: 0px;
 }
 
-toolbarbutton .toolbarbutton-text {
+toolbarbutton:not(.searchengine) .toolbarbutton-text {
   display: none !important;
 }
 
 toolbarbutton:hover,
 toolbarbutton:hover:active,
 toolbarbutton[open="true"] {
   border-color: transparent;
 }
@@ -214,16 +214,20 @@ toolbarbutton.browser-control-button {
   visibility: collapse;
 }
 
 #toolbar-main[mode="edit"] > #urlbar-container > #urlbar-icons > #tool-reload,
 #toolbar-main[mode="edit"] > #urlbar-container > #urlbar-icons > #tool-stop {
   visibility: collapse;
 }
 
+.searchengine {
+  -moz-box-orient: horizontal;
+}
+
 #urlbar-container {
   background-color: transparent;
   color: #000;
   -moz-box-orient: horizontal;
   -moz-box-align: center;
   min-height: 60px;
 }