Bug 1270014 - Show an alert icon on the downloads button when a download fails. r=paolo
MozReview-Commit-ID: LVfRT24SHqN
--- 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) {