Bug 1297039 - Implement the preference for showing dropmarker or not in Downloads Panel., r=Paolo
authorSean Lee <selee@mozilla.com>
Mon, 22 Aug 2016 18:44:24 +0800
changeset 310908 c4f6eb3d1fd8566a87e7f3040bc2a3fd48703fa7
parent 310907 c982394c73fd5a238600da744a14f5a241427532
child 310909 37020799f7842e8137383a8481b6bc8fbf319282
push id80992
push userryanvm@gmail.com
push dateWed, 24 Aug 2016 13:10:06 +0000
treeherdermozilla-inbound@abaf51cc9853 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaolo
bugs1297039
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.");