Bug 1297039 - Implement the preference for showing dropmarker or not in Downloads Panel., r=paolo
MozReview-Commit-ID: ArmPPgLABtA
--- 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.");