Bug 1289774 - Show the attention state instead of the time remaining in the Downloads Indicator. r=mak draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Wed, 27 Jul 2016 14:27:16 +0100
changeset 393232 5283b7cae5f4d7c67ead99211c9f1aceef9a6c7c
parent 393192 78dd94ba93c77d0bba45f8e4525947629a305a41
child 526543 46065cc53c854b2b254171e2625c337f4be1987b
push id24266
push userpaolo.mozmail@amadzone.org
push dateWed, 27 Jul 2016 13:28:01 +0000
reviewersmak
bugs1289774
milestone50.0a1
Bug 1289774 - Show the attention state instead of the time remaining in the Downloads Indicator. r=mak MozReview-Commit-ID: LLTAfsfv8es
browser/components/downloads/DownloadsCommon.jsm
browser/components/downloads/content/indicator.js
--- 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