| 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);
|
| },
|
|
|