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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 PreviousSearchResult: "previousSearchResult" | 49 PreviousSearchResult: "previousSearchResult" |
50 }; | 50 }; |
51 | 51 |
52 apiPrivate.Events = { | 52 apiPrivate.Events = { |
53 AuditStarted: "audit-started-", | 53 AuditStarted: "audit-started-", |
54 ButtonClicked: "button-clicked-", | 54 ButtonClicked: "button-clicked-", |
55 PanelObjectSelected: "panel-objectSelected-", | 55 PanelObjectSelected: "panel-objectSelected-", |
56 NetworkRequestFinished: "network-request-finished", | 56 NetworkRequestFinished: "network-request-finished", |
57 OpenResource: "open-resource", | 57 OpenResource: "open-resource", |
58 PanelSearch: "panel-search-", | 58 PanelSearch: "panel-search-", |
| 59 RecordingStarted: "trace-recording-started-", |
| 60 RecordingStopped: "trace-recording-stopped-", |
59 ResourceAdded: "resource-added", | 61 ResourceAdded: "resource-added", |
60 ResourceContentCommitted: "resource-content-committed", | 62 ResourceContentCommitted: "resource-content-committed", |
61 ViewShown: "view-shown-", | 63 ViewShown: "view-shown-", |
62 ViewHidden: "view-hidden-" | 64 ViewHidden: "view-hidden-" |
63 }; | 65 }; |
64 | 66 |
65 apiPrivate.Commands = { | 67 apiPrivate.Commands = { |
66 AddAuditCategory: "addAuditCategory", | 68 AddAuditCategory: "addAuditCategory", |
67 AddAuditResult: "addAuditResult", | 69 AddAuditResult: "addAuditResult", |
68 AddRequestHeaders: "addRequestHeaders", | 70 AddRequestHeaders: "addRequestHeaders", |
| 71 AddTraceProvider: "addTraceProvider", |
69 ApplyStyleSheet: "applyStyleSheet", | 72 ApplyStyleSheet: "applyStyleSheet", |
70 CreatePanel: "createPanel", | 73 CreatePanel: "createPanel", |
71 CreateSidebarPane: "createSidebarPane", | 74 CreateSidebarPane: "createSidebarPane", |
72 CreateToolbarButton: "createToolbarButton", | 75 CreateToolbarButton: "createToolbarButton", |
73 EvaluateOnInspectedPage: "evaluateOnInspectedPage", | 76 EvaluateOnInspectedPage: "evaluateOnInspectedPage", |
74 ForwardKeyboardEvent: "_forwardKeyboardEvent", | 77 ForwardKeyboardEvent: "_forwardKeyboardEvent", |
75 GetHAR: "getHAR", | 78 GetHAR: "getHAR", |
76 GetPageResources: "getPageResources", | 79 GetPageResources: "getPageResources", |
77 GetRequestContent: "getRequestContent", | 80 GetRequestContent: "getRequestContent", |
78 GetResourceContent: "getResourceContent", | 81 GetResourceContent: "getResourceContent", |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 174 |
172 /** | 175 /** |
173 * @constructor | 176 * @constructor |
174 */ | 177 */ |
175 function InspectorExtensionAPI() | 178 function InspectorExtensionAPI() |
176 { | 179 { |
177 this.audits = new Audits(); | 180 this.audits = new Audits(); |
178 this.inspectedWindow = new InspectedWindow(); | 181 this.inspectedWindow = new InspectedWindow(); |
179 this.panels = new Panels(); | 182 this.panels = new Panels(); |
180 this.network = new Network(); | 183 this.network = new Network(); |
| 184 this.timeline = new Timeline(); |
181 defineDeprecatedProperty(this, "webInspector", "resources", "network"); | 185 defineDeprecatedProperty(this, "webInspector", "resources", "network"); |
182 } | 186 } |
183 | 187 |
184 /** | 188 /** |
185 * @constructor | 189 * @constructor |
186 */ | 190 */ |
187 function Network() | 191 function Network() |
188 { | 192 { |
189 /** | 193 /** |
190 * @this {EventSinkImpl} | 194 * @this {EventSinkImpl} |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 tooltip: tooltipText, | 541 tooltip: tooltipText, |
538 disabled: !!disabled | 542 disabled: !!disabled |
539 }; | 543 }; |
540 extensionServer.sendRequest(request); | 544 extensionServer.sendRequest(request); |
541 } | 545 } |
542 }; | 546 }; |
543 | 547 |
544 /** | 548 /** |
545 * @constructor | 549 * @constructor |
546 */ | 550 */ |
| 551 function Timeline() |
| 552 { |
| 553 } |
| 554 |
| 555 Timeline.prototype = { |
| 556 /** |
| 557 * @param {string} categoryName |
| 558 * @param {string} categoryTooltip |
| 559 * @return {!TraceProvider} |
| 560 */ |
| 561 addTraceProvider: function(categoryName, categoryTooltip) |
| 562 { |
| 563 var id = "extension-timeline-category-" + extensionServer.nextObjectId()
; |
| 564 extensionServer.sendRequest({ command: commands.AddTraceProvider, id: id
, categoryName: categoryName, categoryTooltip: categoryTooltip}); |
| 565 return new TraceProvider(id); |
| 566 } |
| 567 } |
| 568 |
| 569 /** |
| 570 * @constructor |
| 571 */ |
| 572 function TraceProvider(id) |
| 573 { |
| 574 this.onRecordingStarted = new EventSink(events.RecordingStarted + id); |
| 575 this.onRecordingStopped = new EventSink(events.RecordingStopped + id); |
| 576 } |
| 577 |
| 578 /** |
| 579 * @constructor |
| 580 */ |
547 function Audits() | 581 function Audits() |
548 { | 582 { |
549 } | 583 } |
550 | 584 |
551 Audits.prototype = { | 585 Audits.prototype = { |
552 /** | 586 /** |
553 * @return {!AuditCategory} | 587 * @return {!AuditCategory} |
554 */ | 588 */ |
555 addCategory: function(displayName, resultCount) | 589 addCategory: function(displayName, resultCount) |
556 { | 590 { |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 { | 1045 { |
1012 return "(function(injectedScriptId){ " + | 1046 return "(function(injectedScriptId){ " + |
1013 "var extensionServer;" + | 1047 "var extensionServer;" + |
1014 defineCommonExtensionSymbols.toString() + ";" + | 1048 defineCommonExtensionSymbols.toString() + ";" + |
1015 injectedExtensionAPI.toString() + ";" + | 1049 injectedExtensionAPI.toString() + ";" + |
1016 buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName) + ";
" + | 1050 buildPlatformExtensionAPI(extensionInfo, inspectedTabId, themeName) + ";
" + |
1017 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + | 1051 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + |
1018 "return {};" + | 1052 "return {};" + |
1019 "})"; | 1053 "})"; |
1020 } | 1054 } |
OLD | NEW |