| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 */ | 223 */ |
| 224 WebInspector.HandlerSelector = function(handlerRegistry) | 224 WebInspector.HandlerSelector = function(handlerRegistry) |
| 225 { | 225 { |
| 226 this._handlerRegistry = handlerRegistry; | 226 this._handlerRegistry = handlerRegistry; |
| 227 this.element = createElementWithClass("select", "chrome-select"); | 227 this.element = createElementWithClass("select", "chrome-select"); |
| 228 this.element.addEventListener("change", this._onChange.bind(this), false); | 228 this.element.addEventListener("change", this._onChange.bind(this), false); |
| 229 this._update(); | 229 this._update(); |
| 230 this._handlerRegistry.addEventListener(WebInspector.HandlerRegistry.Events.H
andlersUpdated, this._update.bind(this)); | 230 this._handlerRegistry.addEventListener(WebInspector.HandlerRegistry.Events.H
andlersUpdated, this._update.bind(this)); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 WebInspector.HandlerSelector.prototype = | 233 WebInspector.HandlerSelector.prototype = { |
| 234 { | |
| 235 _update: function() | 234 _update: function() |
| 236 { | 235 { |
| 237 this.element.removeChildren(); | 236 this.element.removeChildren(); |
| 238 var names = this._handlerRegistry.handlerNames; | 237 var names = this._handlerRegistry.handlerNames; |
| 239 var activeHandler = this._handlerRegistry.activeHandler; | 238 var activeHandler = this._handlerRegistry.activeHandler; |
| 240 | 239 |
| 241 for (var i = 0; i < names.length; ++i) { | 240 for (var i = 0; i < names.length; ++i) { |
| 242 var option = createElement("option"); | 241 var option = createElement("option"); |
| 243 option.textContent = names[i]; | 242 option.textContent = names[i]; |
| 244 option.selected = activeHandler === names[i]; | 243 option.selected = activeHandler === names[i]; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 316 |
| 318 var handlerSelector = new WebInspector.HandlerSelector(WebInspector.open
AnchorLocationRegistry); | 317 var handlerSelector = new WebInspector.HandlerSelector(WebInspector.open
AnchorLocationRegistry); |
| 319 return WebInspector.SettingsUI.createCustomSetting(WebInspector.UIString
("Link handling:"), handlerSelector.element); | 318 return WebInspector.SettingsUI.createCustomSetting(WebInspector.UIString
("Link handling:"), handlerSelector.element); |
| 320 } | 319 } |
| 321 }; | 320 }; |
| 322 | 321 |
| 323 /** | 322 /** |
| 324 * @type {!WebInspector.HandlerRegistry} | 323 * @type {!WebInspector.HandlerRegistry} |
| 325 */ | 324 */ |
| 326 WebInspector.openAnchorLocationRegistry; | 325 WebInspector.openAnchorLocationRegistry; |
| OLD | NEW |