Bug 1297039 - Implement the preference for showing dropmarker or not in Downloads Panel., r=paolo draft
authorSean Lee <selee@mozilla.com>
Mon, 22 Aug 2016 18:44:24 +0800
changeset 404474 e4ac3e8f28548b7fb88a54e013fe2e5c85660fe4
parent 403732 0c8c9d06919f45fbd65ab0aa76ba59db5754bbae
child 529186 06e5991230cb2acca23df71d307b0d67c3b50b93
push id27211
push userbmo:selee@mozilla.com
push dateTue, 23 Aug 2016 14:24:30 +0000
reviewerspaolo
bugs1297039
milestone51.0a1
Bug 1297039 - Implement the preference for showing dropmarker or not in Downloads Panel., r=paolo MozReview-Commit-ID: ArmPPgLABtA
browser/app/profile/firefox.js
browser/components/downloads/DownloadsCommon.jsm
browser/components/downloads/content/downloads.css
browser/components/downloads/content/downloads.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -323,16 +323,22 @@ pref("browser.download.loglevel", "Error
 // feedback from their action.
 pref("browser.download.saveLinkAsFilenameTimeout", 4000);
 
 pref("browser.download.useDownloadDir", true);
 pref("browser.download.folderList", 1);
 pref("browser.download.manager.addToRecentDocs", true);
 pref("browser.download.manager.resumeOnWakeDelay", 10000);
 
+#ifdef RELEASE_BUILD
+pref("browser.download.showPanelDropmarker", false);
+#else
+pref("browser.download.showPanelDropmarker", true);
+#endif
+
 // This allows disabling the animated notifications shown by
 // the Downloads Indicator when a download starts or completes.
 pref("browser.download.animateNotifications", true);
 
 // This records whether or not the panel has been shown at least once.
 pref("browser.download.panel.shown", false);
 
 #ifndef XP_MACOSX
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -123,17 +123,18 @@ var PrefObserver = {
         return PrefObserver.getPref(name);
       });
     }
   },
 };
 
 PrefObserver.register({
   // prefName: defaultValue
-  animateNotifications: true
+  animateNotifications: true,
+  showPanelDropmarker: true,
 });
 
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadsCommon
 
 /**
  * This object is exposed directly to the consumers of this JavaScript module,
@@ -214,16 +215,23 @@ this.DownloadsCommon = {
    * Indicates whether we should show visual notification on the indicator
    * when a download event is triggered.
    */
   get animateNotifications() {
     return PrefObserver.animateNotifications;
   },
 
   /**
+   * Indicates whether we should show the dropmarker in the Downloads Panel.
+   */
+  get showPanelDropmarker() {
+    return PrefObserver.showPanelDropmarker;
+  },
+
+  /**
    * Get access to one of the DownloadsData or PrivateDownloadsData objects,
    * depending on the privacy status of the window in question.
    *
    * @param aWindow
    *        The browser window which owns the download button.
    */
   getData(aWindow) {
     if (PrivateBrowsingUtils.isContentWindowPrivate(aWindow)) {
--- a/browser/components/downloads/content/downloads.css
+++ b/browser/components/downloads/content/downloads.css
@@ -8,16 +8,21 @@ richlistitem[type="download"] {
   -moz-binding: url('chrome://browser/content/downloads/download.xml#download');
 }
 
 richlistitem[type="download"]:not([selected]) button {
   /* Only focus buttons in the selected item. */
   -moz-user-focus: none;
 }
 
+.downloadsHideDropmarker > #downloadsFooterButtonsSplitter,
+.downloadsHideDropmarker > #downloadsFooterDropmarker {
+  display: none;
+}
+
 richlistitem[type="download"].download-state[state="1"]:not([exists]) .downloadShow {
   display: none;
 }
 
 #downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryProgress,
 #downloadsSummary:not([inprogress]) > vbox > #downloadsSummaryDetails,
 #downloadsFooter[showingsummary] > #downloadsFooterButtons,
 #downloadsFooter:not([showingsummary]) > #downloadsSummary {
--- a/browser/components/downloads/content/downloads.js
+++ b/browser/components/downloads/content/downloads.js
@@ -221,16 +221,24 @@ const DownloadsPanel = {
 
     if (this.isPanelShowing) {
       DownloadsCommon.log("Panel is already showing - focusing instead.");
       this._focusPanel();
       return;
     }
 
     this.initialize(() => {
+      let downloadsFooterButtons =
+        document.getElementById("downloadsFooterButtons");
+      if (DownloadsCommon.showPanelDropmarker) {
+        downloadsFooterButtons.classList.remove("downloadsHideDropmarker");
+      } else {
+        downloadsFooterButtons.classList.add("downloadsHideDropmarker");
+      }
+
       // Delay displaying the panel because this function will sometimes be
       // called while another window is closing (like the window for selecting
       // whether to save or open the file), and that would cause the panel to
       // close immediately.
       setTimeout(() => this._openPopupIfDataReady(), 0);
     });
 
     DownloadsCommon.log("Waiting for the downloads panel to appear.");