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

Unified Diff: chrome/browser/resources/md_downloads/item.js

Issue 1375333004: MD Downloads: use <iron-list> to render download items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iron-list2
Patch Set: merge Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_downloads/item.html ('k') | chrome/browser/resources/md_downloads/manager.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_downloads/item.js
diff --git a/chrome/browser/resources/md_downloads/item.js b/chrome/browser/resources/md_downloads/item.js
index fb5ad710ca502bcddb9ed075f9746c4e1d77036d..3bce0bf934d4287bb201c33ec20d6721235660c3 100644
--- a/chrome/browser/resources/md_downloads/item.js
+++ b/chrome/browser/resources/md_downloads/item.js
@@ -6,14 +6,6 @@ cr.define('downloads', function() {
var Item = Polymer({
is: 'downloads-item',
- /**
- * @param {!downloads.ThrottledIconLoader} iconLoader
- */
- factoryImpl: function(iconLoader) {
- /** @private {!downloads.ThrottledIconLoader} */
- this.iconLoader_ = iconLoader;
- },
-
properties: {
data: {
type: Object,
@@ -24,15 +16,6 @@ cr.define('downloads', function() {
value: true,
},
- readyPromise: {
- type: Object,
- value: function() {
- return new Promise(function(resolve, reject) {
- this.resolveReadyPromise_ = resolve;
- }.bind(this));
- },
- },
-
completelyOnDisk_: {
computed: 'computeCompletelyOnDisk_(' +
'data.state, data.file_externally_removed)',
@@ -105,21 +88,11 @@ cr.define('downloads', function() {
// TODO(dbeam): this gets called way more when I observe data.by_ext_id
// and data.by_ext_name directly. Why?
'observeControlledBy_(controlledBy_)',
+ 'observeIsDangerous_(isDangerous_, data.file_path)',
],
ready: function() {
this.content = this.$.content;
- this.resolveReadyPromise_();
- },
-
- /** @param {!downloads.Data} data */
- update: function(data) {
- this.data = data;
-
- if (!this.isDangerous_) {
- var icon = 'chrome://fileicon/' + encodeURIComponent(data.file_path);
- this.iconLoader_.loadScaledIcon(this.$['file-icon'], icon);
- }
},
/** @private */
@@ -280,6 +253,14 @@ cr.define('downloads', function() {
},
/** @private */
+ observeIsDangerous_: function() {
+ if (this.data && !this.isDangerous_) {
+ var filePath = encodeURIComponent(this.data.file_path);
+ this.$['file-icon'].src = 'chrome://fileicon/' + filePath;
+ }
+ },
+
+ /** @private */
onCancelTap_: function() {
downloads.ActionService.getInstance().cancel(this.data.id);
},
« no previous file with comments | « chrome/browser/resources/md_downloads/item.html ('k') | chrome/browser/resources/md_downloads/manager.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698