Bug 1396414 - Take the popup cancel path when dismissing the appMenu from CustomizableUI. r?Gijs draft
authorSam Foster <sfoster@mozilla.com>
Fri, 22 Sep 2017 17:56:53 -0700
changeset 669374 95699b88f96a3e28837595896ce676e22fffc559
parent 669354 3d72fdb0e561ea59d9e5850c3e71367dbb8a7148
child 732944 0d94a19c4f4b57b1ae0a183277e46e32d5d9d152
push id81317
push userbmo:sfoster@mozilla.com
push dateSat, 23 Sep 2017 01:01:20 +0000
reviewersGijs
bugs1396414
milestone58.0a1
Bug 1396414 - Take the popup cancel path when dismissing the appMenu from CustomizableUI. r?Gijs MozReview-Commit-ID: AWrW7qbP6Si
browser/components/customizableui/CustomizableUI.jsm
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -1757,20 +1757,20 @@ var CustomizableUIInternal = {
       }
       // otherwise, this is the outer button, and the user will now
       // interact with the menu:
       return true;
     }
     return inInput || !inItem;
   },
 
-  hidePanelForNode(aNode) {
+  hidePanelForNode(aNode, aCancel) {
     let panel = this._getPanelForNode(aNode);
     if (panel) {
-      panel.hidePopup();
+      panel.hidePopup(aCancel);
     }
   },
 
   maybeAutoHidePanel(aEvent) {
     if (aEvent.type == "keypress") {
       if (aEvent.keyCode != aEvent.DOM_VK_RETURN) {
         return;
       }
@@ -1820,17 +1820,17 @@ var CustomizableUIInternal = {
         } else {
           multiview.showMainView();
         }
         return;
       }
     }
 
     // If we get here, we can actually hide the popup:
-    this.hidePanelForNode(aEvent.target);
+    this.hidePanelForNode(aEvent.target, true);
   },
 
   getUnusedWidgets(aWindowPalette) {
     let window = aWindowPalette.ownerGlobal;
     let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
     // We use a Set because there can be overlap between the widgets in
     // gPalette and the items in the palette, especially after the first
     // customization, since programmatically generated widgets will remain