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 */ List = cr.ui.List; |
7 /** @const */ ListItem = cr.ui.ListItem; | 7 /** @const */ 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. |
(...skipping 16 matching lines...) Expand all Loading... |
27 decorate: function() { | 27 decorate: function() { |
28 ListItem.prototype.decorate.call(this); | 28 ListItem.prototype.decorate.call(this); |
29 | 29 |
30 this.className = 'deletable-item origin-list-item'; | 30 this.className = 'deletable-item origin-list-item'; |
31 this.contentElement_ = this.ownerDocument.createElement('div'); | 31 this.contentElement_ = this.ownerDocument.createElement('div'); |
32 this.appendChild(this.contentElement_); | 32 this.appendChild(this.contentElement_); |
33 | 33 |
34 var titleEl = this.ownerDocument.createElement('div'); | 34 var titleEl = this.ownerDocument.createElement('div'); |
35 titleEl.className = 'title favicon-cell weaktrl'; | 35 titleEl.className = 'title favicon-cell weaktrl'; |
36 titleEl.textContent = this.origin_; | 36 titleEl.textContent = this.origin_; |
| 37 titleEl.originPattern = this.origin_; |
37 titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); | 38 titleEl.style.backgroundImage = getFaviconImageSet(this.origin_); |
38 this.contentElement_.appendChild(titleEl); | 39 this.contentElement_.appendChild(titleEl); |
39 | 40 |
| 41 this.contentElement_.onclick = function() { |
| 42 chrome.send('maybeShowEditPage', [titleEl.originPattern]); |
| 43 }; |
| 44 |
40 if (this.usageString_) { | 45 if (this.usageString_) { |
41 var usageEl = this.ownerDocument.createElement('span'); | 46 var usageEl = this.ownerDocument.createElement('span'); |
42 usageEl.className = 'local-storage-usage'; | 47 usageEl.className = 'local-storage-usage'; |
43 usageEl.textContent = this.usageString_; | 48 usageEl.textContent = this.usageString_; |
44 this.appendChild(usageEl); | 49 this.appendChild(usageEl); |
45 } | 50 } |
46 } | 51 } |
47 }; | 52 }; |
48 | 53 |
49 var OriginList = cr.ui.define('list'); | 54 var OriginList = cr.ui.define('list'); |
50 | 55 |
51 OriginList.prototype = { | 56 OriginList.prototype = { |
52 __proto__: List.prototype, | 57 __proto__: List.prototype, |
53 | 58 |
54 /** @override */ | 59 /** @override */ |
55 createItem: function(entry) { | 60 createItem: function(entry) { |
56 return new OriginListItem(entry); | 61 return new OriginListItem(entry); |
57 }, | 62 }, |
58 }; | 63 }; |
59 | 64 |
60 return { | 65 return { |
61 OriginListItem: OriginListItem, | 66 OriginListItem: OriginListItem, |
62 OriginList: OriginList, | 67 OriginList: OriginList, |
63 }; | 68 }; |
64 }); | 69 }); |
OLD | NEW |