| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // TODO(dbeam): this gets called way more when I observe data.by_ext_id | 71 // TODO(dbeam): this gets called way more when I observe data.by_ext_id |
| 72 // and data.by_ext_name directly. Why? | 72 // and data.by_ext_name directly. Why? |
| 73 'observeControlledBy_(controlledBy_)', | 73 'observeControlledBy_(controlledBy_)', |
| 74 'observeIsDangerous_(isDangerous_, data)', | 74 'observeIsDangerous_(isDangerous_, data)', |
| 75 ], | 75 ], |
| 76 | 76 |
| 77 ready: function() { | 77 ready: function() { |
| 78 this.content = this.$.content; | 78 this.content = this.$.content; |
| 79 }, | 79 }, |
| 80 | 80 |
| 81 /** |
| 82 * @param {string} url |
| 83 * @return {string} A reasonably long URL. |
| 84 * @private |
| 85 */ |
| 86 chopUrl_: function(url) { |
| 87 return url.slice(0, 300); |
| 88 }, |
| 89 |
| 81 /** @private */ | 90 /** @private */ |
| 82 computeClass_: function() { | 91 computeClass_: function() { |
| 83 var classes = []; | 92 var classes = []; |
| 84 | 93 |
| 85 if (this.isActive_) | 94 if (this.isActive_) |
| 86 classes.push('is-active'); | 95 classes.push('is-active'); |
| 87 | 96 |
| 88 if (this.isDangerous_) | 97 if (this.isDangerous_) |
| 89 classes.push('dangerous'); | 98 classes.push('dangerous'); |
| 90 | 99 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 }, | 323 }, |
| 315 | 324 |
| 316 /** @private */ | 325 /** @private */ |
| 317 onShowTap_: function() { | 326 onShowTap_: function() { |
| 318 downloads.ActionService.getInstance().show(this.data.id); | 327 downloads.ActionService.getInstance().show(this.data.id); |
| 319 }, | 328 }, |
| 320 }); | 329 }); |
| 321 | 330 |
| 322 return {Item: Item}; | 331 return {Item: Item}; |
| 323 }); | 332 }); |
| OLD | NEW |