| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 apiPrivate.Events = { | 59 apiPrivate.Events = { |
| 60 AuditStarted: "audit-started-", | 60 AuditStarted: "audit-started-", |
| 61 ButtonClicked: "button-clicked-", | 61 ButtonClicked: "button-clicked-", |
| 62 ConsoleMessageAdded: "console-message-added", | 62 ConsoleMessageAdded: "console-message-added", |
| 63 PanelObjectSelected: "panel-objectSelected-", | 63 PanelObjectSelected: "panel-objectSelected-", |
| 64 NetworkRequestFinished: "network-request-finished", | 64 NetworkRequestFinished: "network-request-finished", |
| 65 OpenResource: "open-resource", | 65 OpenResource: "open-resource", |
| 66 PanelSearch: "panel-search-", | 66 PanelSearch: "panel-search-", |
| 67 ResourceAdded: "resource-added", | 67 ResourceAdded: "resource-added", |
| 68 ResourceContentCommitted: "resource-content-committed", | 68 ResourceContentCommitted: "resource-content-committed", |
| 69 TimelineEventRecorded: "timeline-event-recorded", | |
| 70 ViewShown: "view-shown-", | 69 ViewShown: "view-shown-", |
| 71 ViewHidden: "view-hidden-" | 70 ViewHidden: "view-hidden-" |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 apiPrivate.Commands = { | 73 apiPrivate.Commands = { |
| 75 AddAuditCategory: "addAuditCategory", | 74 AddAuditCategory: "addAuditCategory", |
| 76 AddAuditResult: "addAuditResult", | 75 AddAuditResult: "addAuditResult", |
| 77 AddConsoleMessage: "addConsoleMessage", | 76 AddConsoleMessage: "addConsoleMessage", |
| 78 AddRequestHeaders: "addRequestHeaders", | 77 AddRequestHeaders: "addRequestHeaders", |
| 79 ApplyStyleSheet: "applyStyleSheet", | 78 ApplyStyleSheet: "applyStyleSheet", |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 /** | 181 /** |
| 183 * @constructor | 182 * @constructor |
| 184 */ | 183 */ |
| 185 function InspectorExtensionAPI() | 184 function InspectorExtensionAPI() |
| 186 { | 185 { |
| 187 this.audits = new Audits(); | 186 this.audits = new Audits(); |
| 188 this.inspectedWindow = new InspectedWindow(); | 187 this.inspectedWindow = new InspectedWindow(); |
| 189 this.panels = new Panels(); | 188 this.panels = new Panels(); |
| 190 this.network = new Network(); | 189 this.network = new Network(); |
| 191 defineDeprecatedProperty(this, "webInspector", "resources", "network"); | 190 defineDeprecatedProperty(this, "webInspector", "resources", "network"); |
| 192 this.timeline = new Timeline(); | |
| 193 this.console = new ConsoleAPI(); | 191 this.console = new ConsoleAPI(); |
| 194 } | 192 } |
| 195 | 193 |
| 196 /** | 194 /** |
| 197 * @constructor | 195 * @constructor |
| 198 */ | 196 */ |
| 199 function ConsoleAPI() | 197 function ConsoleAPI() |
| 200 { | 198 { |
| 201 this.onMessageAdded = new EventSink(events.ConsoleMessageAdded); | 199 this.onMessageAdded = new EventSink(events.ConsoleMessageAdded); |
| 202 } | 200 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 433 |
| 436 var AuditCategory = declareInterfaceClass(AuditCategoryImpl); | 434 var AuditCategory = declareInterfaceClass(AuditCategoryImpl); |
| 437 var AuditResult = declareInterfaceClass(AuditResultImpl); | 435 var AuditResult = declareInterfaceClass(AuditResultImpl); |
| 438 var Button = declareInterfaceClass(ButtonImpl); | 436 var Button = declareInterfaceClass(ButtonImpl); |
| 439 var EventSink = declareInterfaceClass(EventSinkImpl); | 437 var EventSink = declareInterfaceClass(EventSinkImpl); |
| 440 var ExtensionPanel = declareInterfaceClass(ExtensionPanelImpl); | 438 var ExtensionPanel = declareInterfaceClass(ExtensionPanelImpl); |
| 441 var ExtensionSidebarPane = declareInterfaceClass(ExtensionSidebarPaneImpl); | 439 var ExtensionSidebarPane = declareInterfaceClass(ExtensionSidebarPaneImpl); |
| 442 var PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl); | 440 var PanelWithSidebar = declareInterfaceClass(PanelWithSidebarImpl); |
| 443 var Request = declareInterfaceClass(RequestImpl); | 441 var Request = declareInterfaceClass(RequestImpl); |
| 444 var Resource = declareInterfaceClass(ResourceImpl); | 442 var Resource = declareInterfaceClass(ResourceImpl); |
| 445 var Timeline = declareInterfaceClass(TimelineImpl); | |
| 446 | 443 |
| 447 /** | 444 /** |
| 448 * @constructor | 445 * @constructor |
| 449 * @extends {PanelWithSidebar} | 446 * @extends {PanelWithSidebar} |
| 450 */ | 447 */ |
| 451 function ElementsPanel() | 448 function ElementsPanel() |
| 452 { | 449 { |
| 453 PanelWithSidebar.call(this, "elements"); | 450 PanelWithSidebar.call(this, "elements"); |
| 454 } | 451 } |
| 455 | 452 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 827 |
| 831 extensionServer.sendRequest({ command: commands.GetResourceContent, url:
this._url }, callback && callbackWrapper); | 828 extensionServer.sendRequest({ command: commands.GetResourceContent, url:
this._url }, callback && callbackWrapper); |
| 832 }, | 829 }, |
| 833 | 830 |
| 834 setContent: function(content, commit, callback) | 831 setContent: function(content, commit, callback) |
| 835 { | 832 { |
| 836 extensionServer.sendRequest({ command: commands.SetResourceContent, url:
this._url, content: content, commit: commit }, callback); | 833 extensionServer.sendRequest({ command: commands.SetResourceContent, url:
this._url, content: content, commit: commit }, callback); |
| 837 } | 834 } |
| 838 } | 835 } |
| 839 | 836 |
| 840 /** | |
| 841 * @constructor | |
| 842 */ | |
| 843 function TimelineImpl() | |
| 844 { | |
| 845 this.onEventRecorded = new EventSink(events.TimelineEventRecorded); | |
| 846 } | |
| 847 | |
| 848 var keyboardEventRequestQueue = []; | 837 var keyboardEventRequestQueue = []; |
| 849 var forwardTimer = null; | 838 var forwardTimer = null; |
| 850 | 839 |
| 851 function forwardKeyboardEvent(event) | 840 function forwardKeyboardEvent(event) |
| 852 { | 841 { |
| 853 const Esc = "U+001B"; | 842 const Esc = "U+001B"; |
| 854 // We only care about global hotkeys, not about random text | 843 // We only care about global hotkeys, not about random text |
| 855 if (!event.ctrlKey && !event.altKey && !event.metaKey && !/^F\d+$/.test(even
t.keyIdentifier) && event.keyIdentifier !== Esc) | 844 if (!event.ctrlKey && !event.altKey && !event.metaKey && !/^F\d+$/.test(even
t.keyIdentifier) && event.keyIdentifier !== Esc) |
| 856 return; | 845 return; |
| 857 var requestPayload = { | 846 var requestPayload = { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 { | 1039 { |
| 1051 return "(function(injectedScriptId){ " + | 1040 return "(function(injectedScriptId){ " + |
| 1052 "var extensionServer;" + | 1041 "var extensionServer;" + |
| 1053 defineCommonExtensionSymbols.toString() + ";" + | 1042 defineCommonExtensionSymbols.toString() + ";" + |
| 1054 injectedExtensionAPI.toString() + ";" + | 1043 injectedExtensionAPI.toString() + ";" + |
| 1055 buildPlatformExtensionAPI(extensionInfo) + ";" + | 1044 buildPlatformExtensionAPI(extensionInfo) + ";" + |
| 1056 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + | 1045 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + |
| 1057 "return {};" + | 1046 "return {};" + |
| 1058 "})"; | 1047 "})"; |
| 1059 } | 1048 } |
| OLD | NEW |