Bug 1306308 - [One-off searches] Awesomebar results don't show the correct search engine when searching with search engine keywords. r?mak draft
authorDrew Willcoxon <adw@mozilla.com>
Mon, 17 Oct 2016 15:25:26 -0700
changeset 426118 8dcb1827d218f03003141d01649a087b19203a81
parent 406453 3c4c4accb1392bbc70fed3ddebbaa42453963900
child 534105 98146b5e374dd7864b2c7c5dee573a1e8dd4c3b3
push id32630
push userdwillcoxon@mozilla.com
push dateMon, 17 Oct 2016 22:25:48 +0000
reviewersmak
bugs1306308
milestone51.0a1
Bug 1306308 - [One-off searches] Awesomebar results don't show the correct search engine when searching with search engine keywords. r?mak MozReview-Commit-ID: JAK6OghsTiF
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1687,27 +1687,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[