| 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 ItemView = Polymer({ |    6   var ItemView = Polymer({ | 
|    7     is: 'item-view', |    7     is: 'item-view', | 
|    8  |    8  | 
|    9     /** @param {!downloads.ThrottledIconLoader} iconLoader */ |    9     /** @param {!downloads.ThrottledIconLoader} iconLoader */ | 
|   10     factoryImpl: function(iconLoader) { |   10     factoryImpl: function(iconLoader) { | 
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  109           link.setAttribute('column-type', 'controlled-by'); |  109           link.setAttribute('column-type', 'controlled-by'); | 
|  110           link.textContent = data.by_ext_name; |  110           link.textContent = data.by_ext_name; | 
|  111         } |  111         } | 
|  112  |  112  | 
|  113         this.ensureTextIs_(this.$['src-url'], data.url); |  113         this.ensureTextIs_(this.$['src-url'], data.url); | 
|  114         this.$['src-url'].href = data.url; |  114         this.$['src-url'].href = data.url; | 
|  115         this.ensureTextIs_(this.$.status, this.getStatusText_(data)); |  115         this.ensureTextIs_(this.$.status, this.getStatusText_(data)); | 
|  116  |  116  | 
|  117         this.$.progress.hidden = !isInProgress; |  117         this.$.progress.hidden = !isInProgress; | 
|  118  |  118  | 
|  119         // TODO(dbeam): implement progress. |  119         if (isInProgress) | 
 |  120           this.$.progress.value = data.percent; | 
|  120       } |  121       } | 
|  121     }, |  122     }, | 
|  122  |  123  | 
|  123     /** |  124     /** | 
|  124      * Overwrite |el|'s textContent if it differs from |text|. |  125      * Overwrite |el|'s textContent if it differs from |text|. | 
|  125      * @param {!Element} el |  126      * @param {!Element} el | 
|  126      * @param {string} text |  127      * @param {string} text | 
|  127      * @private |  128      * @private | 
|  128      */ |  129      */ | 
|  129     ensureTextIs_: function(el, text) { |  130     ensureTextIs_: function(el, text) { | 
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  241     }, |  242     }, | 
|  242  |  243  | 
|  243     /** @private */ |  244     /** @private */ | 
|  244     onDiscardClick_: function() { |  245     onDiscardClick_: function() { | 
|  245       chrome.send('discardDangerous', [this.id_]); |  246       chrome.send('discardDangerous', [this.id_]); | 
|  246     }, |  247     }, | 
|  247   }); |  248   }); | 
|  248  |  249  | 
|  249   return {ItemView: ItemView}; |  250   return {ItemView: ItemView}; | 
|  250 }); |  251 }); | 
| OLD | NEW |