| 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 HandlerOptions = options.HandlerOptions; | |
| 10 /** @const */ var DeletableItem = options.DeletableItem; | 9 /** @const */ var DeletableItem = options.DeletableItem; |
| 11 /** @const */ var DeletableItemList = options.DeletableItemList; | 10 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * Creates a new ignored protocol / content handler list item. | 13 * Creates a new ignored protocol / content handler list item. |
| 15 * | 14 * |
| 16 * Accepts values in the form | 15 * Accepts values in the form |
| 17 * ['mailto', 'http://www.thesite.com/%s', 'The title of the protocol'], | 16 * ['mailto', 'http://www.thesite.com/%s', 'The title of the protocol'], |
| 18 * @param {Object} entry A dictionary describing the handlers for a given | 17 * @param {Object} entry A dictionary describing the handlers for a given |
| 19 * protocol. | 18 * protocol. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 delegate.removeHandler(value, data.handlers[value]); | 160 delegate.removeHandler(value, data.handlers[value]); |
| 162 }); | 161 }); |
| 163 removeElement.className = 'handlers-remove-column handlers-remove-link'; | 162 removeElement.className = 'handlers-remove-column handlers-remove-link'; |
| 164 this.appendChild(removeElement); | 163 this.appendChild(removeElement); |
| 165 }, | 164 }, |
| 166 | 165 |
| 167 /** @override */ | 166 /** @override */ |
| 168 decorate: function() { | 167 decorate: function() { |
| 169 ListItem.prototype.decorate.call(this); | 168 ListItem.prototype.decorate.call(this); |
| 170 | 169 |
| 171 var self = this; | |
| 172 var delegate = { | 170 var delegate = { |
| 173 removeHandler: function(index, handler) { | 171 removeHandler: function(index, handler) { |
| 174 chrome.send('removeHandler', [handler]); | 172 chrome.send('removeHandler', [handler]); |
| 175 }, | 173 }, |
| 176 setDefault: function(handler) { | 174 setDefault: function(handler) { |
| 177 chrome.send('setDefault', [handler]); | 175 chrome.send('setDefault', [handler]); |
| 178 }, | 176 }, |
| 179 clearDefault: function(protocol) { | 177 clearDefault: function(protocol) { |
| 180 chrome.send('clearDefault', [protocol]); | 178 chrome.send('clearDefault', [protocol]); |
| 181 }, | 179 }, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 }, | 216 }, |
| 219 }; | 217 }; |
| 220 | 218 |
| 221 return { | 219 return { |
| 222 IgnoredHandlersListItem: IgnoredHandlersListItem, | 220 IgnoredHandlersListItem: IgnoredHandlersListItem, |
| 223 IgnoredHandlersList: IgnoredHandlersList, | 221 IgnoredHandlersList: IgnoredHandlersList, |
| 224 HandlerListItem: HandlerListItem, | 222 HandlerListItem: HandlerListItem, |
| 225 HandlersList: HandlersList, | 223 HandlersList: HandlersList, |
| 226 }; | 224 }; |
| 227 }); | 225 }); |
| OLD | NEW |