Chromium Code Reviews| 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 a750e61a193a6ca7a9bd0b89910d42665c48d33a..ce2a0c871b2569ed85faa62eae15fda4d568bb01 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} */ |
|
Dan Beam
2015/10/02 05:37:06
will remove this class fully separately
|
| - this.iconLoader_ = iconLoader; |
| - }, |
| - |
| properties: { |
| data: { |
| type: Object, |
| @@ -24,15 +16,6 @@ cr.define('downloads', function() { |
| value: true, |
| }, |
| - readyPromise: { |
|
Dan Beam
2015/10/02 05:37:06
wasn't needed
|
| - 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 */ |
| @@ -263,6 +236,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 */ |
| onCancelClick_: function() { |
| downloads.ActionService.getInstance().cancel(this.data.id); |
| }, |