Bug 1311998 - [One-off searches] Right click on a result from Awesomebar closes the dropdown. r=mak
authorDrew Willcoxon <adw@mozilla.com>
Thu, 27 Oct 2016 19:44:22 -0700
changeset 320014 5f5c92bae7db3af79043c786f2640fe8fa9cd91e
parent 319960 bb7b2d8063847be1b31867da31218a6d5b6df9db
child 320015 54b73853d144d7c097c089f077a181014d2212bd
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1311998
milestone52.0a1
Bug 1311998 - [One-off searches] Right click on a result from Awesomebar closes the dropdown. r=mak MozReview-Commit-ID: Ieqceceepix
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1362,16 +1362,29 @@ file, You can obtain one at http://mozil
 
       <field name="_oneOffSearchesEnabled">false</field>
 
       <field name="_overrideValue">null</field>
       <property name="overrideValue"
                 onget="return this._overrideValue;"
                 onset="this._overrideValue = val; return val;"/>
 
+      <method name="onPopupClick">
+        <parameter name="aEvent"/>
+        <body><![CDATA[
+          if (aEvent.button == 2) {
+            // Ignore right-clicks.
+            return;
+          }
+          // Otherwise "call super" -- do what autocomplete-base-popup does.
+          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) {
             this.oneOffSearchButtons.telemetryOrigin = "urlbar";
             this.oneOffSearchButtons.style.display = "-moz-box";
             this.oneOffSearchButtons.popup = this;