Bug 1289774 - Show the attention state instead of the time remaining in the Downloads Indicator. r=mak
MozReview-Commit-ID: LLTAfsfv8es
--- 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,
+ showProgressText: false,
});
////////////////////////////////////////////////////////////////////////////////
//// 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 progress text on the indicator.
+ */
+ get showProgressText() {
+ return PrefObserver.showProgressText;
+ },
+
+ /**
* 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/indicator.js
+++ b/browser/components/downloads/content/indicator.js
@@ -387,17 +387,17 @@ const DownloadsIndicatorView = {
},
_hasDownloads: false,
/**
* Status text displayed in the indicator. If this is set to an empty value,
* then the small downloads icon is displayed instead of the text.
*/
set counter(aValue) {
- if (!this._operational) {
+ if (!this._operational || !DownloadsCommon.showProgressText) {
return this._counter;
}
if (this._counter !== aValue) {
this._counter = aValue;
if (this._counter)
this.indicator.setAttribute("counter", "true");
else