Bug 1270014 - Show an alert icon on the downloads button when a download fails. r=paolo draft
authorRex Lee <rexboy@mozilla.com>
Fri, 06 Jan 2017 19:45:23 +0800
changeset 457637 b2d193894d4e309f29744c3789e169d85457077e
parent 452146 c36fbe84042debef0a5d58b7fc88185b401762ce
child 541537 317a0ba242a80e1c096ff2bc9ca642392c2a388c
push id40838
push userbmo:rexboy@mozilla.com
push dateMon, 09 Jan 2017 10:47:49 +0000
reviewerspaolo
bugs1270014
milestone53.0a1
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) {