Bug 1369012 - Don't show the one-off buttons if the only visible engine would be the current one
MozReview-Commit-ID: 7eMQTmQNH3r
--- 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;