Bug 1374477 - Remove page actions from browser.xul. r?Gijs draft
authorDrew Willcoxon <adw@mozilla.com>
Sat, 29 Jul 2017 20:25:01 -0700
changeset 618102 01d4370e8b8ef30dab46b53d3a0c0dee09a1b602
parent 618101 5b86613b29de0e80697c1f96028c0577a3687fa3
child 618103 73f2a4da0de7939fdbb7220eb0dc4079e616321a
push id71221
push userdwillcoxon@mozilla.com
push dateSun, 30 Jul 2017 03:26:37 +0000
reviewersGijs
bugs1374477
milestone56.0a1
Bug 1374477 - Remove page actions from browser.xul. r?Gijs MozReview-Commit-ID: 5nlXfKOx3Aq
browser/base/content/browser-sets.inc
browser/base/content/browser.xul
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -23,21 +23,16 @@
     <command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab(event);"/>
     <command id="cmd_newNavigatorTabNoEvent" oncommand="BrowserOpenTab();"/>
     <command id="Browser:OpenFile"  oncommand="BrowserOpenFileWindow();"/>
     <command id="Browser:SavePage" oncommand="saveBrowser(gBrowser.selectedBrowser);"/>
 
     <command id="Browser:SendLink"
              oncommand="MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);"/>
 
-    <command id="PageAction:copyURL"
-             oncommand="gPageActionButton.copyURL();"/>
-    <command id="PageAction:emailLink"
-             oncommand="gPageActionButton.emailLink();"/>
-
     <command id="cmd_pageSetup" oncommand="PrintUtils.showPageSetup();"/>
     <command id="cmd_print" oncommand="PrintUtils.printWindow(window.gBrowser.selectedBrowser.outerWindowID, window.gBrowser.selectedBrowser);"/>
     <command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
     <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/>
     <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
     <command id="cmd_toggleMute" oncommand="gBrowser.selectedTab.toggleMuteAudio()"/>
     <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
     <command id="cmd_quitApplication" oncommand="goQuitApplication()"/>
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -437,64 +437,52 @@
         <button class="ctrlTab-preview" flex="1"/>
         <button class="ctrlTab-preview" flex="1"/>
       </hbox>
       <hbox pack="center">
         <button id="ctrlTab-showAll" class="ctrlTab-preview" noicon="true"/>
       </hbox>
     </panel>
 
-    <panel id="page-action-panel"
+#ifdef MOZ_PHOTON_THEME
+    <panel id="pageActionPanel"
            class="cui-widget-panel"
            role="group"
            type="arrow"
            hidden="true"
            flip="slide"
            position="bottomcenter topright"
            tabspecific="true"
-           noautofocus="true">
-      <photonpanelmultiview id="page-action-multiView"
-                            mainViewId="page-action-mainView">
-        <panelview id="page-action-mainView"
+           noautofocus="true"
+           context="pageActionPanelContextMenu"
+           oncontextmenu="BrowserPageActions.onContextMenu(event);"
+           copyURL-title="&copyURLCmd.label;"
+           emailLink-title="&emailPageCmd.label;"
+           sendToDevice-title="&sendToDevice.label2;"
+           sendToDevice-notReadyTitle="&sendToDevice.syncNotReady.label;">
+      <photonpanelmultiview id="pageActionPanelMultiView"
+                            mainViewId="pageActionPanelMainView"
+                            viewCacheId="appMenu-viewCache">
+        <panelview id="pageActionPanelMainView"
                    class="PanelUI-subView">
-          <vbox class="panel-subview-body">
-            <toolbarbutton id="page-action-bookmark-button"
-                           class="subviewbutton subviewbutton-iconic"
-                           observes="bookmarkThisPageBroadcaster"
-                           command="Browser:AddBookmarkAs"
-                           onclick="gPageActionButton.panel.hidePopup();"/>
-            <toolbarseparator/>
-            <toolbarbutton id="page-action-copy-url-button"
-                           class="subviewbutton subviewbutton-iconic"
-                           label="&copyURLCmd.label;"
-                           command="PageAction:copyURL"/>
-            <toolbarbutton id="page-action-email-link-button"
-                           class="subviewbutton subviewbutton-iconic"
-                           label="&emailPageCmd.label;"
-                           command="PageAction:emailLink"/>
-            <toolbarbutton id="page-action-send-to-device-button"
-                           class="subviewbutton subviewbutton-iconic subviewbutton-nav"
-                           label="&sendToDevice.label2;"
-                           closemenu="none"
-                           oncommand="gPageActionButton.showSendToDeviceView(this);"/>
-          </vbox>
-        </panelview>
-        <panelview id="page-action-sendToDeviceView"
-                   class="PanelUI-subView"
-                   title="&sendToDevice.viewTitle;">
-          <vbox id="page-action-sendToDeviceView-body" class="panel-subview-body">
-            <toolbarbutton id="page-action-sync-not-ready-button"
-                           class="subviewbutton"
-                           label="&sendToDevice.syncNotReady.label;"
-                           disabled="true"/>
-          </vbox>
+          <vbox class="panel-subview-body"/>
         </panelview>
       </photonpanelmultiview>
     </panel>
 
+    <menupopup id="pageActionPanelContextMenu"
+               onpopupshowing="BrowserPageActions.onContextMenuShowing(event, this);">
+      <menuitem id="pageActionPanelContextMenu-toggleUrlbar"
+                add-label="&pageAction.addToUrlbar.label;"
+                remove-label="&pageAction.removeFromUrlbar.label;"
+                label="&pageAction.addToUrlbar.label;"
+                oncommand="BrowserPageActions.toggleShownInUrlbarForContextAction();"/>
+    </menupopup>
+#endif
+
     <!-- Bookmarks and history tooltip -->
     <tooltip id="bhTooltip"/>
 
     <tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>
 
     <tooltip id="back-button-tooltip">
       <label class="tooltip-label" value="&backButton.tooltip;"/>
 #ifdef XP_MACOSX
@@ -899,34 +887,38 @@
                        class="urlbar-icon"
                        hidden="true"
                        tooltiptext="&pageReportIcon.tooltip;"
                        onmousedown="gPopupBlockerObserver.onReportButtonMousedown(event);"/>
                 <image id="reader-mode-button"
                        class="urlbar-icon"
                        hidden="true"
                        onclick="ReaderParent.buttonClick(event);"/>
+                <toolbarbutton id="urlbar-zoom-button"
+                       onclick="FullZoom.reset();"
+                       tooltip="dynamic-shortcut-tooltip"
+                       hidden="true"/>
 #ifdef MOZ_PHOTON_THEME
+                <image id="pageActionButton"
+                       class="urlbar-icon"
+                       tooltiptext="&pageActionButton.tooltip;"
+                       onclick="BrowserPageActions.mainButtonClicked(event);"/>
                 <hbox id="star-button-box">
                   <image id="star-button"
                          class="urlbar-icon"
                          onclick="BookmarkingUI.onStarCommand(event);">
                     <observes element="bookmarkThisPageBroadcaster" attribute="starred"/>
                     <observes element="bookmarkThisPageBroadcaster" attribute="tooltiptext"/>
                   </image>
                   <hbox id="star-button-animatable-box">
                     <image id="star-button-animatable-image"
                            onclick="BookmarkingUI.onStarCommand(event);"/>
                   </hbox>
                 </hbox>
 #endif
-                <toolbarbutton id="urlbar-zoom-button"
-                       onclick="FullZoom.reset();"
-                       tooltip="dynamic-shortcut-tooltip"
-                       hidden="true"/>
               </hbox>
               <hbox id="userContext-icons" hidden="true">
                 <label id="userContext-label"/>
                 <image id="userContext-indicator"/>
               </hbox>
 #ifndef MOZ_PHOTON_THEME
               <toolbarbutton id="urlbar-go-button"
                              class="chromeclass-toolbar-additional"
@@ -936,21 +928,16 @@
                              class="chromeclass-toolbar-additional"
                              command="Browser:ReloadOrDuplicate"
                              onclick="checkForMiddleClick(this, event);"
                              tooltip="dynamic-shortcut-tooltip"/>
               <toolbarbutton id="stop-button"
                              class="chromeclass-toolbar-additional"
                              command="Browser:Stop"
                              tooltip="dynamic-shortcut-tooltip"/>
-#else
-              <toolbarbutton id="urlbar-page-action-button"
-                             class="chromeclass-toolbar-additional"
-                             tooltiptext="&pageActionButton.tooltip;"
-                             onclick="gPageActionButton.onEvent(event);"/>
 #endif
             </textbox>
           </hbox>
         </toolbaritem>
 
         <toolbaritem id="search-container" title="&searchItem.title;"
                      align="center" class="chromeclass-toolbar-additional panel-wide-item"
                      cui-areatype="toolbar"
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -983,12 +983,13 @@ you can use these alternative items. Oth
 <!ENTITY updateRestart.header.message2 "Restart to update &brandShorterName;.">
 <!ENTITY updateRestart.acceptButton.label "Restart and Restore">
 <!ENTITY updateRestart.acceptButton.accesskey "R">
 <!ENTITY updateRestart.cancelButton.label "Not Now">
 <!ENTITY updateRestart.cancelButton.accesskey "N">
 <!ENTITY updateRestart.panelUI.label2 "Restart to update &brandShorterName;">
 
 <!ENTITY pageActionButton.tooltip "Page actions">
+<!ENTITY pageAction.addToUrlbar.label "Add to Address Bar">
+<!ENTITY pageAction.removeFromUrlbar.label "Remove from Address Bar">
 
 <!ENTITY sendToDevice.label2 "Send to Device">
-<!ENTITY sendToDevice.viewTitle "Send to Device">
 <!ENTITY sendToDevice.syncNotReady.label "Syncing Devices…">