| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ List = cr.ui.List; | 6 /** @const */ var List = cr.ui.List; |
| 7 /** @const */ ListItem = cr.ui.ListItem; | 7 /** @const */ var ListItem = cr.ui.ListItem; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Creates a new list item for the origin's data. | 10 * Creates a new list item for the origin's data. |
| 11 * @param {!Object} origin Data used to create the origin list item. | 11 * @param {!Object} origin Data used to create the origin list item. |
| 12 * @constructor |
| 13 * @extends {cr.ui.ListItem} |
| 12 */ | 14 */ |
| 13 function OriginListItem(origin) { | 15 function OriginListItem(origin) { |
| 14 var el = cr.doc.createElement('div'); | 16 var el = cr.doc.createElement('div'); |
| 15 el.origin_ = origin.origin; | 17 el.origin_ = origin.origin; |
| 16 el.usage_ = origin.usage; | 18 el.usage_ = origin.usage; |
| 17 el.usageString_ = origin.usageString; | 19 el.usageString_ = origin.usageString; |
| 18 el.readableName_ = origin.readableName; | 20 el.readableName_ = origin.readableName; |
| 19 el.__proto__ = OriginListItem.prototype; | 21 el.__proto__ = OriginListItem.prototype; |
| 20 el.decorate(); | 22 el.decorate(); |
| 21 return el; | 23 return el; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 | 47 |
| 46 if (this.usageString_) { | 48 if (this.usageString_) { |
| 47 var usageEl = this.ownerDocument.createElement('span'); | 49 var usageEl = this.ownerDocument.createElement('span'); |
| 48 usageEl.className = 'local-storage-usage'; | 50 usageEl.className = 'local-storage-usage'; |
| 49 usageEl.textContent = this.usageString_; | 51 usageEl.textContent = this.usageString_; |
| 50 this.appendChild(usageEl); | 52 this.appendChild(usageEl); |
| 51 } | 53 } |
| 52 } | 54 } |
| 53 }; | 55 }; |
| 54 | 56 |
| 57 /** |
| 58 * @constructor |
| 59 * @extends {cr.ui.List} |
| 60 */ |
| 55 var OriginList = cr.ui.define('list'); | 61 var OriginList = cr.ui.define('list'); |
| 56 | 62 |
| 57 OriginList.prototype = { | 63 OriginList.prototype = { |
| 58 __proto__: List.prototype, | 64 __proto__: List.prototype, |
| 59 | 65 |
| 60 /** @override */ | 66 /** @override */ |
| 61 createItem: function(entry) { | 67 createItem: function(entry) { |
| 62 return new OriginListItem(entry); | 68 return new OriginListItem(entry); |
| 63 }, | 69 }, |
| 64 }; | 70 }; |
| 65 | 71 |
| 66 return { | 72 return { |
| 67 OriginListItem: OriginListItem, | 73 OriginListItem: OriginListItem, |
| 68 OriginList: OriginList, | 74 OriginList: OriginList, |
| 69 }; | 75 }; |
| 70 }); | 76 }); |
| OLD | NEW |