OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.proxyexceptions', function() { | 5 cr.define('options.proxyexceptions', function() { |
6 /** @const */ var List = cr.ui.List; | 6 /** @const */ var List = cr.ui.List; |
7 /** @const */ var ListItem = cr.ui.ListItem; | 7 /** @const */ var ListItem = cr.ui.ListItem; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 15 matching lines...) Expand all Loading... |
26 this.autoExpands = true; | 26 this.autoExpands = true; |
27 | 27 |
28 // HACK(arv): http://crbug.com/40902 | 28 // HACK(arv): http://crbug.com/40902 |
29 window.addEventListener('resize', this.redraw.bind(this)); | 29 window.addEventListener('resize', this.redraw.bind(this)); |
30 | 30 |
31 this.addEventListener('click', this.handleClick_); | 31 this.addEventListener('click', this.handleClick_); |
32 | 32 |
33 var self = this; | 33 var self = this; |
34 | 34 |
35 // Listens to pref changes. | 35 // Listens to pref changes. |
36 Preferences.getInstance().addEventListener(this.pref, | 36 Preferences.getInstance().addEventListener(this.pref, function(event) { |
37 function(event) { | 37 self.load_(event.value.value); |
38 self.load_(event.value.value); | 38 }); |
39 }); | |
40 }, | 39 }, |
41 | 40 |
42 /** | 41 /** |
43 * @override | 42 * @override |
44 * @param {Object} exception | 43 * @param {Object} exception |
45 */ | 44 */ |
46 createItem: function(exception) { | 45 createItem: function(exception) { |
47 return new ProxyExceptionsItem(exception); | 46 return new ProxyExceptionsItem(exception); |
48 }, | 47 }, |
49 | 48 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ListItem.prototype.decorate.call(this); | 130 ListItem.prototype.decorate.call(this); |
132 this.className = 'exception-list-item'; | 131 this.className = 'exception-list-item'; |
133 | 132 |
134 var labelException = this.ownerDocument.createElement('span'); | 133 var labelException = this.ownerDocument.createElement('span'); |
135 labelException.className = ''; | 134 labelException.className = ''; |
136 labelException.textContent = this.exception; | 135 labelException.textContent = this.exception; |
137 this.appendChild(labelException); | 136 this.appendChild(labelException); |
138 } | 137 } |
139 }; | 138 }; |
140 | 139 |
141 return { | 140 return {ProxyExceptions: ProxyExceptions}; |
142 ProxyExceptions: ProxyExceptions | |
143 }; | |
144 }); | 141 }); |
OLD | NEW |