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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4986a91327fee0d62d9e5444db3dd055c80853ce |
| --- /dev/null |
| +++ b/chrome/browser/resources/options/origin_resources_list.js |
| @@ -0,0 +1,56 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +cr.define('options', function() { |
| + /** @const */ List = cr.ui.List; |
| + /** @const */ ListItem = cr.ui.ListItem; |
| + |
| + function OriginListItem(origin) { |
| + var el = cr.doc.createElement('div'); |
| + el.origin_ = origin; |
| + OriginListItem.decorate(el); |
| + return el; |
| + } |
| + |
| + OriginListItem.decorate = function(el) { |
| + el.__proto__ = OriginListItem.prototype; |
| + el.decorate(); |
|
Dan Beam
2014/07/15 03:39:15
indent off (2 \s less)
Daniel Nishi
2014/07/15 17:12:54
Done.
|
| + }; |
| + |
| + OriginListItem.prototype = { |
| + __proto__: ListItem.prototype, |
| + |
| + /** @override */ |
| + decorate: function() { |
| + ListItem.prototype.decorate.call(this); |
| + |
| + this.classList.add('deletable-item'); |
| + |
| + this.contentElement_ = this.ownerDocument.createElement('div'); |
| + this.appendChild(this.contentElement_); |
| + |
| + var titleEl = this.ownerDocument.createElement('div'); |
| + titleEl.className = 'title favicon-cell weaktrl'; |
| + titleEl.textContent = this.origin_; |
| + titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); |
| + this.contentElement_.appendChild(titleEl); |
| + } |
| + }; |
| + |
| + var OriginList = cr.ui.define('list'); |
| + |
| + OriginList.prototype = { |
| + __proto__: List.prototype, |
| + |
| + /** @override */ |
| + createItem: function(entry) { |
| + return new OriginListItem(entry); |
| + }, |
| + }; |
| + |
| + return { |
| + OriginListItem: OriginListItem, |
| + OriginList: OriginList, |
| + }; |
| +}); |