| 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 Manager = Polymer({ | 6 var Manager = Polymer({ |
| 7 is: 'downloads-manager', | 7 is: 'downloads-manager', |
| 8 | 8 |
| 9 properties: { | 9 properties: { |
| 10 hasDownloads_: { | 10 hasDownloads_: { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 }, | 142 }, |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * @param {number} index | 145 * @param {number} index |
| 146 * @param {!downloads.Data} data | 146 * @param {!downloads.Data} data |
| 147 * @private | 147 * @private |
| 148 */ | 148 */ |
| 149 updateItem_: function(index, data) { | 149 updateItem_: function(index, data) { |
| 150 this.set('items_.' + index, data); | 150 this.set('items_.' + index, data); |
| 151 this.updateHideDates_(index, index); | 151 this.updateHideDates_(index, index); |
| 152 this.$['downloads-list'].updateSizeForItem(index); | 152 var list = /** @type {!IronListElement} */(this.$['downloads-list']); |
| 153 list.updateSizeForItem(index); |
| 153 }, | 154 }, |
| 154 }); | 155 }); |
| 155 | 156 |
| 156 Manager.clearAll = function() { | 157 Manager.clearAll = function() { |
| 157 Manager.get().clearAll_(); | 158 Manager.get().clearAll_(); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 /** @return {!downloads.Manager} */ | 161 /** @return {!downloads.Manager} */ |
| 161 Manager.get = function() { | 162 Manager.get = function() { |
| 162 return /** @type {!downloads.Manager} */( | 163 return /** @type {!downloads.Manager} */( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 174 Manager.removeItem = function(index) { | 175 Manager.removeItem = function(index) { |
| 175 Manager.get().removeItem_(index); | 176 Manager.get().removeItem_(index); |
| 176 }; | 177 }; |
| 177 | 178 |
| 178 Manager.updateItem = function(index, data) { | 179 Manager.updateItem = function(index, data) { |
| 179 Manager.get().updateItem_(index, data); | 180 Manager.get().updateItem_(index, data); |
| 180 }; | 181 }; |
| 181 | 182 |
| 182 return {Manager: Manager}; | 183 return {Manager: Manager}; |
| 183 }); | 184 }); |
| OLD | NEW |