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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 this._registerHandler(commands.CreateToolbarButton, this._onCreateToolbarBut
ton.bind(this)); | 61 this._registerHandler(commands.CreateToolbarButton, this._onCreateToolbarBut
ton.bind(this)); |
62 this._registerHandler(commands.EvaluateOnInspectedPage, this._onEvaluateOnIn
spectedPage.bind(this)); | 62 this._registerHandler(commands.EvaluateOnInspectedPage, this._onEvaluateOnIn
spectedPage.bind(this)); |
63 this._registerHandler(commands.ForwardKeyboardEvent, this._onForwardKeyboard
Event.bind(this)); | 63 this._registerHandler(commands.ForwardKeyboardEvent, this._onForwardKeyboard
Event.bind(this)); |
64 this._registerHandler(commands.GetHAR, this._onGetHAR.bind(this)); | 64 this._registerHandler(commands.GetHAR, this._onGetHAR.bind(this)); |
65 this._registerHandler(commands.GetPageResources, this._onGetPageResources.bi
nd(this)); | 65 this._registerHandler(commands.GetPageResources, this._onGetPageResources.bi
nd(this)); |
66 this._registerHandler(commands.GetRequestContent, this._onGetRequestContent.
bind(this)); | 66 this._registerHandler(commands.GetRequestContent, this._onGetRequestContent.
bind(this)); |
67 this._registerHandler(commands.GetResourceContent, this._onGetResourceConten
t.bind(this)); | 67 this._registerHandler(commands.GetResourceContent, this._onGetResourceConten
t.bind(this)); |
68 this._registerHandler(commands.Reload, this._onReload.bind(this)); | 68 this._registerHandler(commands.Reload, this._onReload.bind(this)); |
69 this._registerHandler(commands.SetOpenResourceHandler, this._onSetOpenResour
ceHandler.bind(this)); | 69 this._registerHandler(commands.SetOpenResourceHandler, this._onSetOpenResour
ceHandler.bind(this)); |
70 this._registerHandler(commands.SetResourceContent, this._onSetResourceConten
t.bind(this)); | 70 this._registerHandler(commands.SetResourceContent, this._onSetResourceConten
t.bind(this)); |
| 71 this._registerHandler(commands.SetSidebarHeight, this._onSetSidebarHeight.bi
nd(this)); |
71 this._registerHandler(commands.SetSidebarContent, this._onSetSidebarContent.
bind(this)); | 72 this._registerHandler(commands.SetSidebarContent, this._onSetSidebarContent.
bind(this)); |
72 this._registerHandler(commands.SetSidebarPage, this._onSetSidebarPage.bind(t
his)); | 73 this._registerHandler(commands.SetSidebarPage, this._onSetSidebarPage.bind(t
his)); |
73 this._registerHandler(commands.ShowPanel, this._onShowPanel.bind(this)); | 74 this._registerHandler(commands.ShowPanel, this._onShowPanel.bind(this)); |
74 this._registerHandler(commands.StopAuditCategoryRun, this._onStopAuditCatego
ryRun.bind(this)); | 75 this._registerHandler(commands.StopAuditCategoryRun, this._onStopAuditCatego
ryRun.bind(this)); |
75 this._registerHandler(commands.Subscribe, this._onSubscribe.bind(this)); | 76 this._registerHandler(commands.Subscribe, this._onSubscribe.bind(this)); |
76 this._registerHandler(commands.OpenResource, this._onOpenResource.bind(this)
); | 77 this._registerHandler(commands.OpenResource, this._onOpenResource.bind(this)
); |
77 this._registerHandler(commands.Unsubscribe, this._onUnsubscribe.bind(this)); | 78 this._registerHandler(commands.Unsubscribe, this._onUnsubscribe.bind(this)); |
78 this._registerHandler(commands.UpdateButton, this._onUpdateButton.bind(this)
); | 79 this._registerHandler(commands.UpdateButton, this._onUpdateButton.bind(this)
); |
79 this._registerHandler(commands.UpdateAuditProgress, this._onUpdateAuditProgr
ess.bind(this)); | 80 this._registerHandler(commands.UpdateAuditProgress, this._onUpdateAuditProgr
ess.bind(this)); |
80 window.addEventListener("message", this._onWindowMessage.bind(this), false);
// Only for main window. | 81 window.addEventListener("message", this._onWindowMessage.bind(this), false);
// Only for main window. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 }, | 328 }, |
328 | 329 |
329 /** | 330 /** |
330 * @return {!Array.<!WebInspector.ExtensionSidebarPane>} | 331 * @return {!Array.<!WebInspector.ExtensionSidebarPane>} |
331 */ | 332 */ |
332 sidebarPanes: function() | 333 sidebarPanes: function() |
333 { | 334 { |
334 return this._sidebarPanes; | 335 return this._sidebarPanes; |
335 }, | 336 }, |
336 | 337 |
| 338 _onSetSidebarHeight: function(message) |
| 339 { |
| 340 var sidebar = this._clientObjects[message.id]; |
| 341 if (!sidebar) |
| 342 return this._status.E_NOTFOUND(message.id); |
| 343 sidebar.setHeight(message.height); |
| 344 return this._status.OK(); |
| 345 }, |
| 346 |
337 _onSetSidebarContent: function(message, port) | 347 _onSetSidebarContent: function(message, port) |
338 { | 348 { |
339 var sidebar = this._clientObjects[message.id]; | 349 var sidebar = this._clientObjects[message.id]; |
340 if (!sidebar) | 350 if (!sidebar) |
341 return this._status.E_NOTFOUND(message.id); | 351 return this._status.E_NOTFOUND(message.id); |
342 | 352 |
343 /** | 353 /** |
344 * @this {WebInspector.ExtensionServer} | 354 * @this {WebInspector.ExtensionServer} |
345 */ | 355 */ |
346 function callback(error) | 356 function callback(error) |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 /** | 1081 /** |
1072 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1082 * @typedef {{code: string, description: string, details: !Array.<*>}} |
1073 */ | 1083 */ |
1074 WebInspector.ExtensionStatus.Record; | 1084 WebInspector.ExtensionStatus.Record; |
1075 | 1085 |
1076 WebInspector.extensionAPI = {}; | 1086 WebInspector.extensionAPI = {}; |
1077 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1087 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
1078 | 1088 |
1079 /** @type {!WebInspector.ExtensionServer} */ | 1089 /** @type {!WebInspector.ExtensionServer} */ |
1080 WebInspector.extensionServer; | 1090 WebInspector.extensionServer; |
OLD | NEW |