OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 cr.define('options', function() { | |
6 /** @const */ List = cr.ui.List; | |
7 /** @const */ ListItem = cr.ui.ListItem; | |
8 | |
9 function OriginListItem(origin) { | |
10 var el = cr.doc.createElement('div'); | |
11 el.origin_ = origin; | |
12 OriginListItem.decorate(el); | |
13 return el; | |
14 } | |
15 | |
16 OriginListItem.decorate = function(el) { | |
17 el.__proto__ = OriginListItem.prototype; | |
18 el.decorate(); | |
Dan Beam
2014/07/15 03:39:15
indent off (2 \s less)
Daniel Nishi
2014/07/15 17:12:54
Done.
| |
19 }; | |
20 | |
21 OriginListItem.prototype = { | |
22 __proto__: ListItem.prototype, | |
23 | |
24 /** @override */ | |
25 decorate: function() { | |
26 ListItem.prototype.decorate.call(this); | |
27 | |
28 this.classList.add('deletable-item'); | |
29 | |
30 this.contentElement_ = this.ownerDocument.createElement('div'); | |
31 this.appendChild(this.contentElement_); | |
32 | |
33 var titleEl = this.ownerDocument.createElement('div'); | |
34 titleEl.className = 'title favicon-cell weaktrl'; | |
35 titleEl.textContent = this.origin_; | |
36 titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); | |
37 this.contentElement_.appendChild(titleEl); | |
38 } | |
39 }; | |
40 | |
41 var OriginList = cr.ui.define('list'); | |
42 | |
43 OriginList.prototype = { | |
44 __proto__: List.prototype, | |
45 | |
46 /** @override */ | |
47 createItem: function(entry) { | |
48 return new OriginListItem(entry); | |
49 }, | |
50 }; | |
51 | |
52 return { | |
53 OriginListItem: OriginListItem, | |
54 OriginList: OriginList, | |
55 }; | |
56 }); | |
OLD | NEW |