| 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 properties: { | 9 properties: { |
| 10 data: { | 10 data: { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (!this.data.by_ext_id || !this.data.by_ext_name) | 114 if (!this.data.by_ext_id || !this.data.by_ext_name) |
| 115 return ''; | 115 return ''; |
| 116 | 116 |
| 117 var url = 'chrome://extensions#' + this.data.by_ext_id; | 117 var url = 'chrome://extensions#' + this.data.by_ext_id; |
| 118 var name = this.data.by_ext_name; | 118 var name = this.data.by_ext_name; |
| 119 return loadTimeData.getStringF('controlledByUrl', url, name); | 119 return loadTimeData.getStringF('controlledByUrl', url, name); |
| 120 }, | 120 }, |
| 121 | 121 |
| 122 /** @private */ | 122 /** @private */ |
| 123 computeDangerIcon_: function() { | 123 computeDangerIcon_: function() { |
| 124 if (!this.isDangerous_) | 124 return this.isDangerous_ ? 'cr:warning' : ''; |
| 125 return ''; | |
| 126 | |
| 127 switch (this.data.danger_type) { | |
| 128 case downloads.DangerType.DANGEROUS_CONTENT: | |
| 129 case downloads.DangerType.DANGEROUS_HOST: | |
| 130 case downloads.DangerType.DANGEROUS_URL: | |
| 131 case downloads.DangerType.POTENTIALLY_UNWANTED: | |
| 132 case downloads.DangerType.UNCOMMON_CONTENT: | |
| 133 return 'downloads:remove-circle'; | |
| 134 default: | |
| 135 return 'cr:warning'; | |
| 136 } | |
| 137 }, | 125 }, |
| 138 | 126 |
| 139 /** @private */ | 127 /** @private */ |
| 140 computeDate_: function() { | 128 computeDate_: function() { |
| 141 assert(typeof this.data.hideDate == 'boolean'); | 129 assert(typeof this.data.hideDate == 'boolean'); |
| 142 if (this.data.hideDate) | 130 if (this.data.hideDate) |
| 143 return ''; | 131 return ''; |
| 144 return assert(this.data.since_string || this.data.date_string); | 132 return assert(this.data.since_string || this.data.date_string); |
| 145 }, | 133 }, |
| 146 | 134 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 }, | 311 }, |
| 324 | 312 |
| 325 /** @private */ | 313 /** @private */ |
| 326 onShowTap_: function() { | 314 onShowTap_: function() { |
| 327 downloads.ActionService.getInstance().show(this.data.id); | 315 downloads.ActionService.getInstance().show(this.data.id); |
| 328 }, | 316 }, |
| 329 }); | 317 }); |
| 330 | 318 |
| 331 return {Item: Item}; | 319 return {Item: Item}; |
| 332 }); | 320 }); |
| OLD | NEW |