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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 var styleSheet = document.createElement("style"); | 213 var styleSheet = document.createElement("style"); |
214 styleSheet.textContent = message.styleSheet; | 214 styleSheet.textContent = message.styleSheet; |
215 document.head.appendChild(styleSheet); | 215 document.head.appendChild(styleSheet); |
216 }, | 216 }, |
217 | 217 |
218 _onCreatePanel: function(message, port) | 218 _onCreatePanel: function(message, port) |
219 { | 219 { |
220 var id = message.id; | 220 var id = message.id; |
221 // The ids are generated on the client API side and must be unique, so t
he check below | 221 // The ids are generated on the client API side and must be unique, so t
he check below |
222 // shouldn't be hit unless someone is bypassing the API. | 222 // shouldn't be hit unless someone is bypassing the API. |
223 if (id in this._clientObjects || id in WebInspector.panels) | 223 if (id in this._clientObjects || WebInspector.inspectorView.hasPanel(id)
) |
224 return this._status.E_EXISTS(id); | 224 return this._status.E_EXISTS(id); |
225 | 225 |
226 var page = this._expandResourcePath(port._extensionOrigin, message.page)
; | 226 var page = this._expandResourcePath(port._extensionOrigin, message.page)
; |
227 var panelDescriptor = new WebInspector.ExtensionServerPanelDescriptor(id
, message.title, new WebInspector.ExtensionPanel(id, page)); | 227 var panelDescriptor = new WebInspector.ExtensionServerPanelDescriptor(id
, message.title, new WebInspector.ExtensionPanel(id, page)); |
228 this._clientObjects[id] = panelDescriptor.panel(); | 228 this._clientObjects[id] = panelDescriptor.panel(); |
229 WebInspector.inspectorView.addPanel(panelDescriptor); | 229 WebInspector.inspectorView.addPanel(panelDescriptor); |
230 return this._status.OK(); | 230 return this._status.OK(); |
231 }, | 231 }, |
232 | 232 |
233 _onShowPanel: function(message) | 233 _onShowPanel: function(message) |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 /** | 1071 /** |
1072 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1072 * @typedef {{code: string, description: string, details: !Array.<*>}} |
1073 */ | 1073 */ |
1074 WebInspector.ExtensionStatus.Record; | 1074 WebInspector.ExtensionStatus.Record; |
1075 | 1075 |
1076 WebInspector.extensionAPI = {}; | 1076 WebInspector.extensionAPI = {}; |
1077 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1077 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
1078 | 1078 |
1079 importScript("ExtensionPanel.js"); | 1079 importScript("ExtensionPanel.js"); |
1080 importScript("ExtensionView.js"); | 1080 importScript("ExtensionView.js"); |
OLD | NEW |