Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: chrome/browser/resources/md_downloads/item.js

Issue 1301723002: MD Downloads: update "expanded" (i.e. in progress) cards (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dep Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('downloads', function() { 5 cr.define('downloads', function() {
6 var Item = Polymer({ 6 var Item = Polymer({
7 is: 'downloads-item', 7 is: 'downloads-item',
8 8
9 /** 9 /**
10 * @param {!downloads.ThrottledIconLoader} iconLoader 10 * @param {!downloads.ThrottledIconLoader} iconLoader
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 this.$.content.classList.toggle('dangerous', this.isDangerous_); 73 this.$.content.classList.toggle('dangerous', this.isDangerous_);
74 74
75 var description = dangerText || this.getStatusText_(data); 75 var description = dangerText || this.getStatusText_(data);
76 76
77 // Status goes in the "tag" (next to the file name) if there's no file. 77 // Status goes in the "tag" (next to the file name) if there's no file.
78 this.ensureTextIs_(this.$.description, isActive ? description : ''); 78 this.ensureTextIs_(this.$.description, isActive ? description : '');
79 this.ensureTextIs_(this.$.tag, isActive ? '' : description); 79 this.ensureTextIs_(this.$.tag, isActive ? '' : description);
80 80
81 /** @const */ var showProgress = 81 /** @const */ var showProgress =
82 isFinite(data.percent) && !this.isDangerous_; 82 isFinite(data.percent) && !this.isDangerous_;
83 this.$.progress.hidden = !showProgress; 83 this.$.content.classList.toggle('show-progress', showProgress);
84 84
85 if (showProgress) { 85 if (showProgress) {
86 this.$.progress.indeterminate = data.percent < 0; 86 this.$.progress.indeterminate = data.percent < 0;
87 this.$.progress.value = data.percent; 87 this.$.progress.value = data.percent;
88 } 88 }
89 89
90 var disableRemove; 90 var disableRemove;
91 91
92 if (this.isDangerous_) { 92 if (this.isDangerous_) {
93 this.isMalware_ = 93 this.isMalware_ =
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 }, 269 },
270 270
271 /** @private */ 271 /** @private */
272 onShowClick_: function() { 272 onShowClick_: function() {
273 this.actionService_.show(this.id_); 273 this.actionService_.show(this.id_);
274 }, 274 },
275 }); 275 });
276 276
277 return {Item: Item}; 277 return {Item: Item};
278 }); 278 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698