Chromium Code Reviews| Index: chrome/browser/resources/options/origin_resources_list.js |
| diff --git a/chrome/browser/resources/options/origin_resources_list.js b/chrome/browser/resources/options/origin_resources_list.js |
| index 62efad450a330719bf81cc1351ae61a2cb4b5aa9..80c68e25d7b2f6e233251dc42a5e5e8872595197 100644 |
| --- a/chrome/browser/resources/options/origin_resources_list.js |
| +++ b/chrome/browser/resources/options/origin_resources_list.js |
| @@ -8,7 +8,16 @@ cr.define('options', function() { |
| function OriginListItem(origin) { |
| var el = cr.doc.createElement('div'); |
| - el.origin_ = origin; |
| + |
| + if (origin.origin) { |
| + el.origin_ = origin.origin; |
| + el.usage_ = origin.usage; |
| + el.usage_string_ = origin.usage_string; |
| + } |
| + else { |
|
Bernhard Bauer
2014/07/22 08:51:47
Else goes on the same line as the closing brace.
Daniel Nishi
2014/07/22 22:30:56
Done.
|
| + el.origin_ = origin; |
| + } |
| + |
| el.__proto__ = OriginListItem.prototype; |
| el.decorate(); |
| return el; |
| @@ -21,8 +30,7 @@ cr.define('options', function() { |
| decorate: function() { |
| ListItem.prototype.decorate.call(this); |
| - this.classList.add('deletable-item'); |
| - |
| + this.className = 'deletable-item origin-list-item'; |
| this.contentElement_ = this.ownerDocument.createElement('div'); |
| this.appendChild(this.contentElement_); |
| @@ -31,6 +39,13 @@ cr.define('options', function() { |
| titleEl.textContent = this.origin_; |
| titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); |
| this.contentElement_.appendChild(titleEl); |
| + |
| + if (this.usage_string_) { |
| + var usageEl = this.ownerDocument.createElement('span'); |
| + usageEl.className = 'usage'; |
| + usageEl.textContent = this.usage_string_; |
| + this.appendChild(usageEl); |
| + } |
| } |
| }; |