Bug 1306308 - [One-off searches] Awesomebar results don't show the correct search engine when searching with search engine keywords. r=mak a=gchang
authorDrew Willcoxon <adw@mozilla.com>
Mon, 17 Oct 2016 15:25:26 -0700
changeset 356181 ef8ca045351940ed9ef04a4eff500b4df05efd0f
parent 356180 c969b37d09730bac645e6fa34c12dcaa9a89f9ad
child 356182 49dfb63c28b9c093f13391b999de40b01f125613
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, gchang
bugs1306308
milestone51.0a2
Bug 1306308 - [One-off searches] Awesomebar results don't show the correct search engine when searching with search engine keywords. r=mak a=gchang MozReview-Commit-ID: JAK6OghsTiF
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1716,27 +1716,18 @@ file, You can obtain one at http://mozil
           this.input.handleCommand(event, where, params);
         ]]></body>
       </method>
 
       <!-- Result listitems call this to determine which search engine they
            should show in their labels and include in their url attributes. -->
       <property name="overrideSearchEngineName" readonly="true">
         <getter><![CDATA[
-          // When building the popup, autocomplete reuses an item at index i if
-          // that item's url attribute matches the controller's value at index
-          // i, but only if overrideSearchEngineName matches the engine in the
-          // url attribute.  To absolutely avoid reusing items that shouldn't be
-          // reused, always return a non-null name here by falling back to the
-          // current engine.
-          let engine =
-            (this.oneOffSearchButtons.selectedButton &&
-             this.oneOffSearchButtons.selectedButton.engine) ||
-             Services.search.currentEngine;
-          return engine ? engine.name : null;
+          let button = this.oneOffSearchButtons.selectedButton;
+          return button && button.engine && button.engine.name;
         ]]></getter>
       </property>
 
       <method name="createResultLabel">
         <parameter name="item"/>
         <parameter name="proposedLabel"/>
         <body>
           <![CDATA[