Changeset 82814 in webkit
- Timestamp:
- Apr 4, 2011 3:10:29 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r82813 r82814 1 2011-04-04 Andrey Kosyakov <caseq@chromium.org> 2 3 Unreviewed. Followup to an incomplete commit in r82806. 4 5 * inspector/extensions/extensions.html: 6 1 7 2011-04-04 Pavel Podivilov <podivilov@chromium.org> 2 8 -
trunk/LayoutTests/inspector/extensions/extensions.html
r82806 r82814 16 16 } 17 17 18 function extension_test CreateSidebar(nextTest)18 function extension_testSidebarPage(nextTest) 19 19 { 20 20 function onSidebarCreated(sidebar) … … 22 22 output("Sidebar created"); 23 23 dumpObject(sidebar); 24 sidebar.onUpdated.addListener(nextTest); 25 sidebar.setPage("extension-sidebar.html"); 24 26 } 25 27 webInspector.panels.elements.createSidebarPane("Test Sidebar", onSidebarCreated); … … 31 33 } 32 34 33 function extension_test ExtensionWatchSidebarObject(nextTest)35 function extension_testSidebarWatchObject(nextTest) 34 36 { 35 37 function onSidebarCreated(sidebar) … … 49 51 }); 50 52 } 51 webInspector.panels.elements.create WatchExpressionSidebarPane("Watch Test: Object", onSidebarCreated);53 webInspector.panels.elements.createSidebarPane("Watch Test: Object", onSidebarCreated); 52 54 } 53 55 54 function extension_test ExtensionWatchSidebarExpression(nextTest)56 function extension_testSidebarWatchExpression(nextTest) 55 57 { 56 58 function onSidebarCreated(sidebar) … … 75 77 sidebar.setExpression("(" + expression.toString() + ")();", "title"); 76 78 } 77 webInspector.panels.elements.create WatchExpressionSidebarPane("Watch Test: Expression", onSidebarCreated);79 webInspector.panels.elements.createSidebarPane("Watch Test: Expression", onSidebarCreated); 78 80 } 79 81 -
trunk/Source/WebCore/ChangeLog
r82811 r82814 1 2011-04-04 Andrey Kosyakov <caseq@chromium.org> 2 3 Unreviewed. Followup to an incomplete commit in r82806. 4 5 * inspector/front-end/ExtensionAPI.js: 6 (WebInspector.injectedExtensionAPI.PanelWithSidebarImpl.prototype.createSidebarPane): 7 (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl): 8 (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setHeight): 9 (WebInspector.injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression): 10 (WebInspector.injectedExtensionAPI): 11 * inspector/front-end/ExtensionPanel.js: 12 (WebInspector.ExtensionSidebarPane): 13 (WebInspector.ExtensionSidebarPane.prototype.setPage): 14 (WebInspector.ExtensionSidebarPane.prototype._setObject): 15 * inspector/front-end/ExtensionServer.js: 16 (WebInspector.ExtensionServer): 17 (WebInspector.ExtensionServer.prototype.notifyExtensionSidebarUpdated): 18 (WebInspector.ExtensionServer.prototype._onCreatePanel): 19 (WebInspector.ExtensionServer.prototype._onCreateSidebarPane): 20 (WebInspector.ExtensionServer.prototype.createClientIframe): 21 (WebInspector.ExtensionServer.prototype._onSetSidebarContent): 22 1 23 2011-04-04 Yury Semikhatsky <yurys@chromium.org> 2 24 -
trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js
r82806 r82814 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 191 191 192 192 PanelWithSidebarImpl.prototype = { 193 createSidebarPane: function(title, url,callback)193 createSidebarPane: function(title, callback) 194 194 { 195 195 var id = "extension-sidebar-" + extensionServer.nextObjectId(); … … 205 205 } 206 206 extensionServer.sendRequest(request, callback && callbackWrapper); 207 },208 209 createWatchExpressionSidebarPane: function(title, callback)210 {211 var id = "watch-sidebar-" + extensionServer.nextObjectId();212 var request = {213 command: "createWatchExpressionSidebarPane",214 panel: this._id,215 id: id,216 title: title217 };218 function callbackWrapper()219 {220 callback(new WatchExpressionSidebarPane(id));221 }222 extensionServer.sendRequest(request, callback && callbackWrapper);223 207 } 224 208 } … … 242 226 { 243 227 this._id = id; 228 this.onUpdated = new EventSink("sidebar-updated-" + id); 244 229 } 245 230 … … 248 233 { 249 234 extensionServer.sendRequest({ command: "setSidebarHeight", id: this._id, height: height }); 250 } 251 } 252 253 function WatchExpressionSidebarPaneImpl(id) 254 { 255 ExtensionSidebarPaneImpl.call(this, id); 256 this.onUpdated = new EventSink("watch-sidebar-updated-" + id); 257 } 258 259 WatchExpressionSidebarPaneImpl.prototype = { 235 }, 236 260 237 setExpression: function(expression, rootTitle) 261 238 { 262 extensionServer.sendRequest({ command: "set WatchSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true });239 extensionServer.sendRequest({ command: "setSidebarContent", id: this._id, expression: expression, rootTitle: rootTitle, evaluateOnPage: true }); 263 240 }, 264 241 … … 272 249 extensionServer.sendRequest({ command: "setSidebarPage", id: this._id, url: expandURL(url) }); 273 250 } 274 }275 276 WatchExpressionSidebarPaneImpl.prototype.__proto__ = ExtensionSidebarPaneImpl.prototype;277 278 function WatchExpressionSidebarPane(id)279 {280 var impl = new WatchExpressionSidebarPaneImpl(id);281 ExtensionSidebarPane.call(this, id, impl);282 251 } 283 252 … … 516 485 var PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl); 517 486 var Resource = declareInterfaceClass(ResourceImpl); 518 var WatchExpressionSidebarPane = declareInterfaceClass(WatchExpressionSidebarPaneImpl);519 487 520 488 var extensionServer = new ExtensionServerClient(); -
trunk/Source/WebCore/inspector/front-end/ExtensionPanel.js
r80845 r82814 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 82 82 WebInspector.ExtensionPanel.prototype.__proto__ = WebInspector.Panel.prototype; 83 83 84 WebInspector.Extension WatchSidebarPane = function(title, id)84 WebInspector.ExtensionSidebarPane = function(title, id) 85 85 { 86 86 WebInspector.SidebarPane.call(this, title); … … 88 88 } 89 89 90 WebInspector.Extension WatchSidebarPane.prototype = {90 WebInspector.ExtensionSidebarPane.prototype = { 91 91 setObject: function(object, title) 92 92 { … … 97 97 { 98 98 RuntimeAgent.evaluate(expression, "extension-watch", false, this._onEvaluate.bind(this, title)); 99 }, 100 101 setPage: function(url) 102 { 103 this.bodyElement.removeChildren(); 104 WebInspector.extensionServer.createClientIframe(this.bodyElement, url); 105 // TODO: Consider doing this upon load event. 106 WebInspector.extensionServer.notifyExtensionSidebarUpdated(this._id); 99 107 }, 100 108 … … 113 121 section.expanded = true; 114 122 this.bodyElement.appendChild(section.element); 115 WebInspector.extensionServer.notifyExtension WatchSidebarUpdated(this._id);123 WebInspector.extensionServer.notifyExtensionSidebarUpdated(this._id); 116 124 } 117 125 } 118 126 119 WebInspector.Extension WatchSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype;127 WebInspector.ExtensionSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype; -
trunk/Source/WebCore/inspector/front-end/ExtensionServer.js
r82806 r82814 43 43 this._registerHandler("addAuditResult", this._onAddAuditResult.bind(this)); 44 44 this._registerHandler("createPanel", this._onCreatePanel.bind(this)); 45 this._registerHandler("createSidebarPane", this._onCreateSidebar.bind(this)); 46 this._registerHandler("createWatchExpressionSidebarPane", this._onCreateWatchExpressionSidebarPane.bind(this)); 45 this._registerHandler("createSidebarPane", this._onCreateSidebarPane.bind(this)); 47 46 this._registerHandler("evaluateOnInspectedPage", this._onEvaluateOnInspectedPage.bind(this)); 48 47 this._registerHandler("getHAR", this._onGetHAR.bind(this)); … … 51 50 this._registerHandler("reload", this._onReload.bind(this)); 52 51 this._registerHandler("setSidebarHeight", this._onSetSidebarHeight.bind(this)); 53 this._registerHandler("setWatchSidebarContent", this._onSetWatchSidebarContent.bind(this)); 52 this._registerHandler("setSidebarContent", this._onSetSidebarContent.bind(this)); 53 this._registerHandler("setSidebarPage", this._onSetSidebarPage.bind(this)); 54 54 this._registerHandler("stopAuditCategoryRun", this._onStopAuditCategoryRun.bind(this)); 55 55 this._registerHandler("subscribe", this._onSubscribe.bind(this)); … … 95 95 }, 96 96 97 notifyExtension WatchSidebarUpdated: function(id)98 { 99 this._postNotification(" watch-sidebar-updated-" + id);97 notifyExtensionSidebarUpdated: function(id) 98 { 99 this._postNotification("sidebar-updated-" + id); 100 100 }, 101 101 … … 196 196 WebInspector.addPanel(panel); 197 197 198 var iframe = this. _createClientIframe(panel.element, message.url);198 var iframe = this.createClientIframe(panel.element, message.url); 199 199 iframe.style.height = "100%"; 200 200 return this._status.OK(); 201 201 }, 202 202 203 _onCreateSidebar: function(message) 204 { 205 var sidebar = this._createSidebar(message, WebInspector.SidebarPane); 206 if (sidebar.isError) 207 return sidebar; 208 this._createClientIframe(sidebar.bodyElement, message.url); 209 return this._status.OK(); 210 }, 211 212 _onCreateWatchExpressionSidebarPane: function(message) 213 { 214 var sidebar = this._createSidebar(message, WebInspector.ExtensionWatchSidebarPane); 215 return sidebar.isError ? sidebar : this._status.OK(); 216 }, 217 218 _createSidebar: function(message, constructor) 203 _onCreateSidebarPane: function(message, constructor) 219 204 { 220 205 var panel = WebInspector.panels[message.panel]; … … 224 209 return this._status.E_NOTSUPPORTED(); 225 210 var id = message.id; 226 var sidebar = new constructor(message.title, message.id);211 var sidebar = new WebInspector.ExtensionSidebarPane(message.title, message.id); 227 212 this._clientObjects[id] = sidebar; 228 213 panel.sidebarPanes[id] = sidebar; 229 214 panel.sidebarElement.appendChild(sidebar.element); 230 215 231 return sidebar;232 }, 233 234 _createClientIframe: function(parent, url, requestId, port)216 return this._status.OK(); 217 }, 218 219 createClientIframe: function(parent, url) 235 220 { 236 221 var iframe = document.createElement("iframe"); … … 249 234 }, 250 235 251 _onSet WatchSidebarContent: function(message)236 _onSetSidebarContent: function(message) 252 237 { 253 238 var sidebar = this._clientObjects[message.id];
Note: See TracChangeset
for help on using the changeset viewer.