Bug 1117145 - Part 3 - Share the download item binding between the Panel and the Library. r=jaws draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Thu, 11 Feb 2016 21:00:38 +0000
changeset 330928 d2938e83954c4162825a442311352b3e20d0a13c
parent 330927 d7664756102fd09d59b17cb38c0376f688c20382
child 330929 613897cae143156ab20438cd5a75198aa4414a99
push id10859
push userpaolo.mozmail@amadzone.org
push dateSun, 14 Feb 2016 17:41:24 +0000
reviewersjaws
bugs1117145
milestone47.0a1
Bug 1117145 - Part 3 - Share the download item binding between the Panel and the Library. r=jaws MozReview-Commit-ID: D8wNJxSJm84
browser/base/content/browser.xul
browser/base/content/global-scripts.inc
browser/components/downloads/content/allDownloadsViewOverlay.js
browser/components/downloads/content/download.xml
browser/components/downloads/content/downloads.css
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -64,16 +64,18 @@
 # All JS files which are not content (only) dependent that browser.xul
 # wishes to include *must* go into the global-scripts.inc file
 # so that they can be shared by macBrowserOverlay.xul.
 #include global-scripts.inc
 <script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
 
 <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
 
+<script type="application/javascript" src="chrome://browser/content/downloads/downloads.js"/>
+<script type="application/javascript" src="chrome://browser/content/downloads/indicator.js"/>
 <script type="application/javascript" src="chrome://browser/content/places/editBookmarkOverlay.js"/>
 
 # All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
 # browser-sets.inc file for sharing with hiddenWindow.xul.
 #define FULL_BROWSER_WINDOW
 #include browser-sets.inc
 #undef FULL_BROWSER_WINDOW
 
--- a/browser/base/content/global-scripts.inc
+++ b/browser/base/content/global-scripts.inc
@@ -2,18 +2,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <script type="application/javascript" src="chrome://global/content/printUtils.js"/>
 <script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
 <script type="application/javascript" src="chrome://browser/content/places/browserPlacesViews.js"/>
 <script type="application/javascript" src="chrome://browser/content/browser.js"/>
-<script type="application/javascript" src="chrome://browser/content/downloads/downloads.js"/>
-<script type="application/javascript" src="chrome://browser/content/downloads/indicator.js"/>
 <script type="application/javascript" src="chrome://browser/content/customizableui/panelUI.js"/>
 <script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
 <script type="application/javascript" src="chrome://global/content/viewSourceUtils.js"/>
 
 <script type="application/javascript" src="chrome://browser/content/browser-addons.js"/>
 <script type="application/javascript" src="chrome://browser/content/browser-ctrlTab.js"/>
 <script type="application/javascript" src="chrome://browser/content/browser-customization.js"/>
 <script type="application/javascript" src="chrome://browser/content/browser-devedition.js"/>
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -500,16 +500,27 @@ HistoryDownloadElementShell.prototype = 
 
     // Ensure the interface has been updated based on the new values. We need to
     // do this because history downloads can't trigger update notifications.
     this._updateProgress();
   }),
 };
 
 /**
+ * Relays commands from the download.xml binding to the selected items.
+ */
+const DownloadsView = {
+  onDownloadCommand(event, command) {
+    goDoCommand(command);
+  },
+
+  onDownloadClick() {},
+};
+
+/**
  * A Downloads Places View is a places view designed to show a places query
  * for history downloads alongside the session downloads.
  *
  * As we don't use the places controller, some methods implemented by other
  * places views are not implemented by this view.
  *
  * A richlistitem in this view can represent either a past download or a session
  * download, or both. Session downloads are shown first in the view, and as long
--- a/browser/components/downloads/content/download.xml
+++ b/browser/components/downloads/content/download.xml
@@ -62,58 +62,16 @@
                     oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_show');"/>
         <xul:button class="downloadButton downloadConfirmBlock"
                     tooltiptext="&cmd.removeFile.label;"
                     oncommand="DownloadsView.onDownloadCommand(event, 'downloadsCmd_confirmBlock');"/>
       </xul:stack>
     </content>
   </binding>
 
-  <binding id="download-full-ui"
-           extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
-    <content orient="horizontal" align="center">
-      <xul:image class="downloadTypeIcon"
-                 validate="always"
-                 xbl:inherits="src=image"/>
-      <xul:image class="downloadTypeIcon blockedIcon"/>
-      <xul:vbox pack="center" flex="1">
-        <xul:description class="downloadTarget"
-                         crop="center"
-                         xbl:inherits="value=displayName,tooltiptext=displayName"/>
-        <xul:progressmeter anonid="progressmeter"
-                           class="downloadProgress"
-                           min="0"
-                           max="100"
-                           xbl:inherits="mode=progressmode,value=progress"/>
-        <xul:description class="downloadDetails"
-                         style="width: &downloadDetails.width;"
-                         crop="end"
-                         xbl:inherits="value=status,tooltiptext=statusTip"/>
-      </xul:vbox>
-      <xul:stack>
-        <xul:button class="downloadButton downloadCancel"
-                    tooltiptext="&cmd.cancel.label;"
-                    oncommand="goDoCommand('downloadsCmd_cancel')"/>
-        <xul:button class="downloadButton downloadRetry"
-                    tooltiptext="&cmd.retry.label;"
-                    oncommand="goDoCommand('downloadsCmd_retry')"/>
-        <xul:button class="downloadButton downloadShow"
-#ifdef XP_MACOSX
-                    tooltiptext="&cmd.showMac.label;"
-#else
-                    tooltiptext="&cmd.show.label;"
-#endif
-                    oncommand="goDoCommand('downloadsCmd_show')"/>
-        <xul:button class="downloadButton downloadConfirmBlock"
-                    tooltiptext="&cmd.removeFile.label;"
-                    oncommand="goDoCommand('downloadsCmd_confirmBlock');"/>
-      </xul:stack>
-    </content>
-  </binding>
-
   <binding id="download-toolbarbutton"
            extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
     <content>
       <children />
       <xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
       <xul:label class="toolbarbutton-text" crop="right" flex="1"
                  xbl:inherits="value=label,accesskey,crop,wrap"/>
       <xul:label class="toolbarbutton-multiline-text" flex="1"
--- a/browser/components/downloads/content/downloads.css
+++ b/browser/components/downloads/content/downloads.css
@@ -39,17 +39,17 @@ richlistitem[type="download"].download-s
  *
  * We might be able to do away with this workaround once bug 653881 is fixed.
  */
 richlistitem.download {
   -moz-binding: none;
 }
 
 richlistitem.download[active] {
-  -moz-binding: url("chrome://browser/content/downloads/download.xml#download-full-ui");
+  -moz-binding: url("chrome://browser/content/downloads/download.xml#download");
 }
 
 richlistitem.download button {
   /* These buttons should never get focus, as that would "disable"
      the downloads view controller (it's only used when the richlistbox
      is focused). */
   -moz-user-focus: none;
 }