Bug 1270014 - Show an alert icon on the downloads button when a download fails. r=Paolo
authorRex Lee <rexboy@mozilla.com>
Fri, 06 Jan 2017 19:45:23 +0800
changeset 328782 7bf3fa172915ed2159abee69b9c895e74f9f8a01
parent 328781 800cdcd929ed0493983204d86b69475e2489bd64
child 328783 6f8f397d5cd18f71c8398d1611082300711eaac8
push id85546
push userkwierso@gmail.com
push dateWed, 11 Jan 2017 02:36:30 +0000
treeherdermozilla-inbound@c5bce4cd684a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaolo
bugs1270014
milestone53.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 1270014 - Show an alert icon on the downloads button when a download fails. r=Paolo MozReview-Commit-ID: LVfRT24SHqN
browser/components/downloads/DownloadsCommon.jsm
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -1190,22 +1190,27 @@ DownloadsIndicatorDataCtor.prototype = {
         case Downloads.Error.BLOCK_VERDICT_MALWARE:
           this.attention = DownloadsCommon.ATTENTION_SEVERE;
           break;
         default:
           this.attention = DownloadsCommon.ATTENTION_SEVERE;
           Cu.reportError("Unknown reputation verdict: " +
                          download.error.reputationCheckVerdict);
       }
-    } else if (download.succeeded || download.error) {
+    } else if (download.succeeded) {
       // Existing higher level attention indication trumps ATTENTION_SUCCESS.
       if (this._attention != DownloadsCommon.ATTENTION_SEVERE &&
           this._attention != DownloadsCommon.ATTENTION_WARNING) {
         this.attention = DownloadsCommon.ATTENTION_SUCCESS;
       }
+    } else if (download.error) {
+      // Existing higher level attention indication trumps ATTENTION_WARNING.
+      if (this._attention != DownloadsCommon.ATTENTION_SEVERE) {
+        this.attention = DownloadsCommon.ATTENTION_WARNING;
+      }
     }
 
     // Since the state of a download changed, reset the estimated time left.
     this._lastRawTimeLeft = -1;
     this._lastTimeLeft = -1;
   },
 
   onDownloadChanged(download) {