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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 delete this._handlers[name]; | 89 delete this._handlers[name]; |
90 this.dispatchEventToListeners(WebInspector.HandlerRegistry.EventTypes.Ha
ndlersUpdated); | 90 this.dispatchEventToListeners(WebInspector.HandlerRegistry.EventTypes.Ha
ndlersUpdated); |
91 }, | 91 }, |
92 | 92 |
93 /** | 93 /** |
94 * @param {WebInspector.ContextMenu} contextMenu | 94 * @param {WebInspector.ContextMenu} contextMenu |
95 * @param {Object} target | 95 * @param {Object} target |
96 */ | 96 */ |
97 appendApplicableItems: function(contextMenu, target) | 97 appendApplicableItems: function(contextMenu, target) |
98 { | 98 { |
99 if (!(target instanceof WebInspector.UISourceCode || target instanceof W
ebInspector.Resource)) | 99 if (!(target instanceof WebInspector.UISourceCode || target instanceof W
ebInspector.Resource || target instanceof WebInspector.NetworkRequest)) |
100 return; | 100 return; |
101 var contentProvider = /** @type {WebInspector.ContentProvider} */ target
; | 101 var contentProvider = /** @type {WebInspector.ContentProvider} */ target
; |
102 if (!contentProvider.contentURL()) | 102 if (!contentProvider.contentURL()) |
103 return; | 103 return; |
104 | 104 |
105 contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspec
tor.openResource.bind(WebInspector, contentProvider.contentURL(), false)); | 105 contextMenu.appendItem(WebInspector.openLinkExternallyLabel(), WebInspec
tor.openResource.bind(WebInspector, contentProvider.contentURL(), false)); |
106 // Skip 0th handler, as it's 'Use default panel' one. | 106 // Skip 0th handler, as it's 'Use default panel' one. |
107 for (var i = 1; i < this.handlerNames.length; ++i) { | 107 for (var i = 1; i < this.handlerNames.length; ++i) { |
108 var handler = this.handlerNames[i]; | 108 var handler = this.handlerNames[i]; |
109 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa
seMenuTitles() ? "Open using %s" : "Open Using %s", handler), | 109 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa
seMenuTitles() ? "Open using %s" : "Open Using %s", handler), |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 this.element.disabled = names.length <= 1; | 171 this.element.disabled = names.length <= 1; |
172 }, | 172 }, |
173 | 173 |
174 _onChange: function(event) | 174 _onChange: function(event) |
175 { | 175 { |
176 var value = event.target.value; | 176 var value = event.target.value; |
177 this._handlerRegistry.activeHandler = value; | 177 this._handlerRegistry.activeHandler = value; |
178 } | 178 } |
179 } | 179 } |
OLD | NEW |