Bug 1369012 - Don't show the one-off buttons if the only visible engine would be the current one draft
authorPanos Astithas <past@mozilla.com>
Sat, 26 Aug 2017 19:20:37 +0300
changeset 653611 8611cf2c9e66ad998b8f93c5d5ff43aac2e28e84
parent 652924 b6b8e616de32af50c9a174006b3a7ed914130aa5
child 728376 1804697343a36ff98d02a0093c607f8e4fc45742
push id76368
push userbmo:past@mozilla.com
push dateSat, 26 Aug 2017 16:21:10 +0000
bugs1369012
milestone57.0a1
Bug 1369012 - Don't show the one-off buttons if the only visible engine would be the current one MozReview-Commit-ID: 7eMQTmQNH3r
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1698,18 +1698,19 @@ file, You can obtain one at http://mozil
           let controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController);
           controller.handleEnter(true, aEvent);
         ]]></body>
       </method>
 
       <method name="enableOneOffSearches">
         <parameter name="enable"/>
         <body><![CDATA[
-          this._oneOffSearchesEnabled = enable;
-          if (enable) {
+          let moreThanOne = Services.search.getVisibleEngines().length > 1;
+          this._oneOffSearchesEnabled = enable && moreThanOne;
+          if (enable && moreThanOne) {
             this.oneOffSearchButtons.telemetryOrigin = "urlbar";
             this.oneOffSearchButtons.style.display = "-moz-box";
             // Set .textbox first, since the popup setter will cause
             // a _rebuild call that uses it.
             this.oneOffSearchButtons.textbox = this.input;
             this.oneOffSearchButtons.popup = this;
           } else {
             this.oneOffSearchButtons.telemetryOrigin = null;