Bug 1296554 - Show a static progress bar for downloads of unknown size. r=jaws
MozReview-Commit-ID: HgRl7vlTp3Z
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -1216,17 +1216,24 @@ DownloadsIndicatorDataCtor.prototype = {
*/
_refreshProperties() {
let summary =
DownloadsCommon.summarizeDownloads(this._activeDownloads());
// Determine if the indicator should be shown or get attention.
this._hasDownloads = (this._itemCount > 0);
- this._percentComplete = summary.percentComplete;
+ // Always show a progress bar if there are downloads in progress.
+ if (summary.percentComplete >= 0) {
+ this._percentComplete = summary.percentComplete;
+ } else if (summary.numDownloading > 0) {
+ this._percentComplete = 0;
+ } else {
+ this._percentComplete = -1;
+ }
}
};
XPCOMUtils.defineLazyGetter(this, "PrivateDownloadsIndicatorData", function() {
return new DownloadsIndicatorDataCtor(true);
});
XPCOMUtils.defineLazyGetter(this, "DownloadsIndicatorData", function() {