| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 type: Boolean, | 24 type: Boolean, |
| 25 value: false, | 25 value: false, |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 scrollbarWidth: { | 28 scrollbarWidth: { |
| 29 type: Number, | 29 type: Number, |
| 30 value: 0, | 30 value: 0, |
| 31 observer: 'onScrollbarWidthChange_', | 31 observer: 'onScrollbarWidthChange_', |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 /** @private */ |
| 34 isDangerous_: {type: Boolean, value: false}, | 35 isDangerous_: {type: Boolean, value: false}, |
| 35 | 36 |
| 36 /** Only set when |isDangerous| is true. */ | 37 /** @private */ |
| 38 isIncognito_: {type: Boolean, value: false}, |
| 39 |
| 40 /** |
| 41 * Only set when |isDangerous| is true. |
| 42 * @private |
| 43 */ |
| 37 isMalware_: Boolean, | 44 isMalware_: Boolean, |
| 38 }, | 45 }, |
| 39 | 46 |
| 40 /** @param {!downloads.Data} data */ | 47 /** @param {!downloads.Data} data */ |
| 41 update: function(data) { | 48 update: function(data) { |
| 42 assert(!this.id_ || data.id == this.id_); | 49 assert(!this.id_ || data.id == this.id_); |
| 43 this.id_ = data.id; // This is the only thing saved from |data|. | 50 this.id_ = data.id; // This is the only thing saved from |data|. |
| 44 | 51 |
| 52 this.isIncognito_ = data.otr; |
| 53 |
| 45 // Danger-independent UI and controls. | 54 // Danger-independent UI and controls. |
| 46 this.ensureTextIs_(this.$.since, data.since_string); | 55 this.ensureTextIs_(this.$.since, data.since_string); |
| 47 this.ensureTextIs_(this.$.date, data.date_string); | 56 this.ensureTextIs_(this.$.date, data.date_string); |
| 48 | 57 |
| 49 /** @const */ var noFile = | 58 /** @const */ var noFile = |
| 50 data.state == downloads.States.CANCELLED || | 59 data.state == downloads.States.CANCELLED || |
| 51 data.state == downloads.States.INTERRUPTED || | 60 data.state == downloads.States.INTERRUPTED || |
| 52 data.file_externally_removed; | 61 data.file_externally_removed; |
| 53 this.$.content.classList.toggle('no-file', noFile); | 62 this.$.content.classList.toggle('no-file', noFile); |
| 54 | 63 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 }, | 272 }, |
| 264 | 273 |
| 265 /** @private */ | 274 /** @private */ |
| 266 onShowClick_: function() { | 275 onShowClick_: function() { |
| 267 this.actionService_.show(this.id_); | 276 this.actionService_.show(this.id_); |
| 268 }, | 277 }, |
| 269 }); | 278 }); |
| 270 | 279 |
| 271 return {Item: Item}; | 280 return {Item: Item}; |
| 272 }); | 281 }); |
| OLD | NEW |