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', function() { | 5 cr.define('options', function() { |
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
7 /** @const */ var List = cr.ui.List; | 7 /** @const */ var List = cr.ui.List; |
8 /** @const */ var ListItem = cr.ui.ListItem; | 8 /** @const */ var ListItem = cr.ui.ListItem; |
9 /** @const */ var DeletableItem = options.DeletableItem; | 9 /** @const */ var DeletableItem = options.DeletableItem; |
10 /** @const */ var DeletableItemList = options.DeletableItemList; | 10 /** @const */ var DeletableItemList = options.DeletableItemList; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 protocolElement.textContent = data.protocol; | 126 protocolElement.textContent = data.protocol; |
127 protocolElement.className = 'handlers-type-column'; | 127 protocolElement.className = 'handlers-type-column'; |
128 this.appendChild(protocolElement); | 128 this.appendChild(protocolElement); |
129 | 129 |
130 // Handler selection. | 130 // Handler selection. |
131 var handlerElement = document.createElement('div'); | 131 var handlerElement = document.createElement('div'); |
132 var selectElement = document.createElement('select'); | 132 var selectElement = document.createElement('select'); |
133 var defaultOptionElement = document.createElement('option'); | 133 var defaultOptionElement = document.createElement('option'); |
134 defaultOptionElement.selected = data.default_handler == -1; | 134 defaultOptionElement.selected = data.default_handler == -1; |
135 defaultOptionElement.textContent = | 135 defaultOptionElement.textContent = |
136 loadTimeData.getString('handlers_none_handler'); | 136 loadTimeData.getString('handlersNoneHandler'); |
137 defaultOptionElement.value = -1; | 137 defaultOptionElement.value = -1; |
138 selectElement.appendChild(defaultOptionElement); | 138 selectElement.appendChild(defaultOptionElement); |
139 | 139 |
140 for (var i = 0; i < data.handlers.length; ++i) { | 140 for (var i = 0; i < data.handlers.length; ++i) { |
141 var optionElement = document.createElement('option'); | 141 var optionElement = document.createElement('option'); |
142 optionElement.selected = i == data.default_handler; | 142 optionElement.selected = i == data.default_handler; |
143 optionElement.textContent = data.handlers[i][2]; | 143 optionElement.textContent = data.handlers[i][2]; |
144 optionElement.value = i; | 144 optionElement.value = i; |
145 selectElement.appendChild(optionElement); | 145 selectElement.appendChild(optionElement); |
146 } | 146 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } else { | 185 } else { |
186 indicator.controlledBy = 'recommended'; | 186 indicator.controlledBy = 'recommended'; |
187 } | 187 } |
188 this.appendChild(indicator); | 188 this.appendChild(indicator); |
189 } | 189 } |
190 | 190 |
191 if (data.is_default_handler_set_by_user) { | 191 if (data.is_default_handler_set_by_user) { |
192 // Remove link. | 192 // Remove link. |
193 var removeElement = document.createElement('div'); | 193 var removeElement = document.createElement('div'); |
194 removeElement.textContent = | 194 removeElement.textContent = |
195 loadTimeData.getString('handlers_remove_link'); | 195 loadTimeData.getString('handlersRemoveLink'); |
196 removeElement.addEventListener('click', function(e) { | 196 removeElement.addEventListener('click', function(e) { |
197 var value = selectElement ? selectElement.value : 0; | 197 var value = selectElement ? selectElement.value : 0; |
198 delegate.removeHandler(value, data.handlers[value]); | 198 delegate.removeHandler(value, data.handlers[value]); |
199 }); | 199 }); |
200 removeElement.className = | 200 removeElement.className = |
201 'handlers-remove-column handlers-remove-link'; | 201 'handlers-remove-column handlers-remove-link'; |
202 this.appendChild(removeElement); | 202 this.appendChild(removeElement); |
203 } | 203 } |
204 }, | 204 }, |
205 | 205 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 }, | 259 }, |
260 }; | 260 }; |
261 | 261 |
262 return { | 262 return { |
263 IgnoredHandlersListItem: IgnoredHandlersListItem, | 263 IgnoredHandlersListItem: IgnoredHandlersListItem, |
264 IgnoredHandlersList: IgnoredHandlersList, | 264 IgnoredHandlersList: IgnoredHandlersList, |
265 HandlerListItem: HandlerListItem, | 265 HandlerListItem: HandlerListItem, |
266 HandlersList: HandlersList, | 266 HandlersList: HandlersList, |
267 }; | 267 }; |
268 }); | 268 }); |
OLD | NEW |