Bug 1388029 - remove useless param from PanelUI.showSubView, r?jaws draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 07 Nov 2017 11:54:47 +0000
changeset 697173 2e397c004676162cc96da903e7b7c2aebc17a17c
parent 697096 fc194660762d1b92e1679d860a8bf41116d0f54f
child 697174 a2a5ee13cd4c26cbe255f8f604019e893d8ffdee
push id88916
push userbmo:gijskruitbosch+bugs@gmail.com
push dateMon, 13 Nov 2017 14:22:40 +0000
reviewersjaws
bugs1388029
milestone59.0a1
Bug 1388029 - remove useless param from PanelUI.showSubView, r?jaws MozReview-Commit-ID: 9hkYtLxAOtQ
browser/base/content/browser-places.js
browser/base/content/browser-sync.js
browser/base/content/browser.xul
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/content/panelUI.js
browser/components/customizableui/moz.build
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1771,18 +1771,17 @@ var BookmarkingUI = {
     this._showSubView(null, anchor);
   },
 
   _showSubView(event, anchor = document.getElementById(this.BOOKMARK_BUTTON_ID)) {
     let view = document.getElementById("PanelUI-bookmarks");
     view.addEventListener("ViewShowing", this);
     view.addEventListener("ViewHiding", this);
     anchor.setAttribute("closemenu", "none");
-    PanelUI.showSubView("PanelUI-bookmarks", anchor,
-                        CustomizableUI.AREA_PANEL, event);
+    PanelUI.showSubView("PanelUI-bookmarks", anchor, event);
   },
 
   onCommand: function BUI_onCommand(aEvent) {
     if (aEvent.target != aEvent.currentTarget) {
       return;
     }
 
     // Handle special case when the button is in the panel.
--- a/browser/base/content/browser-sync.js
+++ b/browser/base/content/browser-sync.js
@@ -520,28 +520,29 @@ var gSync = {
   },
 
   openPrefs(entryPoint = "syncbutton", origin = undefined) {
     window.openPreferences("paneSync", { origin, urlParams: { entrypoint: entryPoint } });
   },
 
   openSyncedTabsPanel() {
     let placement = CustomizableUI.getPlacementOfWidget("sync-button");
-    let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR;
+    let area = placement && placement.area;
     let anchor = document.getElementById("sync-button") ||
                  document.getElementById("PanelUI-menu-button");
-    if (area == CustomizableUI.AREA_PANEL) {
-      // The button is in the panel, so we need to show the panel UI, then our
-      // subview.
-      PanelUI.show().then(() => {
-        PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
-      }).catch(Cu.reportError);
+    if (area == CustomizableUI.AREA_FIXED_OVERFLOW_PANEL) {
+      // The button is in the overflow panel, so we need to show the panel,
+      // then show our subview.
+      let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
+      navbar.overflowable.show().then(() => {
+        PanelUI.showSubView("PanelUI-remotetabs", anchor);
+      }, Cu.reportError);
     } else {
       // It is placed somewhere else - just try and show it.
-      PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
+      PanelUI.showSubView("PanelUI-remotetabs", anchor);
     }
   },
 
   /* Update the tooltip for the sync-status broadcaster (which will update the
      Sync Toolbar button and the Sync spinner in the FxA hamburger area.)
      If Sync is configured, the tooltip is when the last sync occurred,
      otherwise the tooltip reflects the fact that Sync needs to be
      (re-)configured.
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -923,17 +923,17 @@
                        removable="true"
                        overflows="false"
                        cui-areatype="toolbar"
                        hidden="true"
                        tooltip="dynamic-shortcut-tooltip"/>
 
         <toolbarbutton id="library-button" class="toolbarbutton-1 chromeclass-toolbar-additional subviewbutton-nav"
                        removable="true"
-                       onmousedown="PanelUI.showSubView('appMenu-libraryView', this, null, event);"
+                       onmousedown="PanelUI.showSubView('appMenu-libraryView', this, event);"
                        closemenu="none"
                        cui-areatype="toolbar"
                        tooltiptext="&libraryButton.tooltip;"
                        label="&places.library.title;"/>
 
       </hbox>
 
       <toolbarbutton id="nav-bar-overflow-button"
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -1625,17 +1625,17 @@ var CustomizableUIInternal = {
 
         let hasMultiView = !!aNode.closest("photonpanelmultiview,panelmultiview");
         if (wrapper && !hasMultiView && wrapper.anchor) {
           this.hidePanelForNode(aNode);
           anchor = wrapper.anchor;
         }
       }
 
-      ownerWindow.PanelUI.showSubView(aWidget.viewId, anchor, area, aEvent);
+      ownerWindow.PanelUI.showSubView(aWidget.viewId, anchor, aEvent);
     }
   },
 
   handleWidgetClick(aWidget, aNode, aEvent) {
     log.debug("handleWidgetClick");
     if (aWidget.onClick) {
       try {
         aWidget.onClick.call(null, aEvent);
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -362,21 +362,19 @@ const PanelUI = {
     this.multiView.showSubView("PanelUI-helpView", aAnchor);
   },
 
   /**
    * Shows a subview in the panel with a given ID.
    *
    * @param aViewId the ID of the subview to show.
    * @param aAnchor the element that spawned the subview.
-   * @param aPlacementArea the CustomizableUI area that aAnchor is in.
    * @param aEvent the event triggering the view showing.
    */
-  async showSubView(aViewId, aAnchor, aPlacementArea, aEvent) {
-
+  async showSubView(aViewId, aAnchor, aEvent) {
     let domEvent = null;
     if (aEvent) {
       if (aEvent.type == "mousedown" && aEvent.button != 0) {
         return;
       }
       if (aEvent.type == "command" && aEvent.inputSource != null) {
         // Synthesize a new DOM mouse event to pass on the inputSource.
         domEvent = document.createEvent("MouseEvent");
--- a/browser/components/customizableui/moz.build
+++ b/browser/components/customizableui/moz.build
@@ -11,17 +11,16 @@ DIRS += [
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
 
 EXTRA_JS_MODULES += [
     'CustomizableUI.jsm',
     'CustomizableWidgets.jsm',
     'CustomizeMode.jsm',
     'DragPositionManager.jsm',
     'PanelMultiView.jsm',
-    'PanelWideWidgetTracker.jsm',
     'ScrollbarSampler.jsm',
     'SearchWidgetTracker.jsm',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
     DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
 
 with Files('**'):