| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 | 685 |
| 686 this._registerSubscriptionHandler(WebInspector.extensionAPI.Events.Panel
ObjectSelected + "elements", | 686 this._registerSubscriptionHandler(WebInspector.extensionAPI.Events.Panel
ObjectSelected + "elements", |
| 687 onElementsSubscriptionStarted.bind(this), onElementsSubscriptionStop
ped.bind(this)); | 687 onElementsSubscriptionStarted.bind(this), onElementsSubscriptionStop
ped.bind(this)); |
| 688 | 688 |
| 689 this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.P
anelObjectSelected + "sources", | 689 this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.P
anelObjectSelected + "sources", |
| 690 WebInspector.notifications, | 690 WebInspector.notifications, |
| 691 WebInspector.SourceFrame.Events.SelectionChanged, | 691 WebInspector.SourceFrame.Events.SelectionChanged, |
| 692 this._notifySourceFrameSelectionChanged); | 692 this._notifySourceFrameSelectionChanged); |
| 693 this._registerResourceContentCommittedHandler(this._notifyUISourceCodeCo
ntentCommitted); | 693 this._registerResourceContentCommittedHandler(this._notifyUISourceCodeCo
ntentCommitted); |
| 694 | 694 |
| 695 /** | |
| 696 * @this {WebInspector.ExtensionServer} | |
| 697 */ | |
| 698 function onTimelineSubscriptionStarted() | |
| 699 { | |
| 700 var mainTarget = WebInspector.targetManager.mainTarget(); | |
| 701 mainTarget.timelineManager.addEventListener(WebInspector.TimelineMan
ager.EventTypes.TimelineEventRecorded, | |
| 702 this._notifyTimelineEventRecorded, this); | |
| 703 mainTarget.timelineManager.start(); | |
| 704 } | |
| 705 | |
| 706 /** | |
| 707 * @this {WebInspector.ExtensionServer} | |
| 708 */ | |
| 709 function onTimelineSubscriptionStopped() | |
| 710 { | |
| 711 var mainTarget = WebInspector.targetManager.mainTarget(); | |
| 712 mainTarget.timelineManager.stop(function() {}); | |
| 713 mainTarget.timelineManager.removeEventListener(WebInspector.Timeline
Manager.EventTypes.TimelineEventRecorded, | |
| 714 this._notifyTimelineEventRecorded, this); | |
| 715 } | |
| 716 | |
| 717 this._registerSubscriptionHandler(WebInspector.extensionAPI.Events.Timel
ineEventRecorded, | |
| 718 onTimelineSubscriptionStarted.bind(this), onTimelineSubscriptionStop
ped.bind(this)); | |
| 719 | |
| 720 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.InspectedURLChanged, | 695 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.InspectedURLChanged, |
| 721 this._inspectedURLChanged, this); | 696 this._inspectedURLChanged, this); |
| 722 | 697 |
| 723 InspectorExtensionRegistry.getExtensionsAsync(); | 698 InspectorExtensionRegistry.getExtensionsAsync(); |
| 724 }, | 699 }, |
| 725 | 700 |
| 726 /** | 701 /** |
| 727 * @param {!WebInspector.TextRange} textRange | 702 * @param {!WebInspector.TextRange} textRange |
| 728 */ | 703 */ |
| 729 _makeSourceSelection: function(textRange) | 704 _makeSourceSelection: function(textRange) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 // Wake up the "network" module for HAR operations. | 744 // Wake up the "network" module for HAR operations. |
| 770 WebInspector.inspectorView.panel("network"); | 745 WebInspector.inspectorView.panel("network"); |
| 771 this._postNotification(WebInspector.extensionAPI.Events.NetworkRequestFi
nished, this._requestId(request), (new WebInspector.HAREntry(request)).build()); | 746 this._postNotification(WebInspector.extensionAPI.Events.NetworkRequestFi
nished, this._requestId(request), (new WebInspector.HAREntry(request)).build()); |
| 772 }, | 747 }, |
| 773 | 748 |
| 774 _notifyElementsSelectionChanged: function() | 749 _notifyElementsSelectionChanged: function() |
| 775 { | 750 { |
| 776 this._postNotification(WebInspector.extensionAPI.Events.PanelObjectSelec
ted + "elements"); | 751 this._postNotification(WebInspector.extensionAPI.Events.PanelObjectSelec
ted + "elements"); |
| 777 }, | 752 }, |
| 778 | 753 |
| 779 _notifyTimelineEventRecorded: function(event) | |
| 780 { | |
| 781 this._postNotification(WebInspector.extensionAPI.Events.TimelineEventRec
orded, event.data); | |
| 782 }, | |
| 783 | |
| 784 /** | 754 /** |
| 785 * @param {!Array.<!ExtensionDescriptor>} extensionInfos | 755 * @param {!Array.<!ExtensionDescriptor>} extensionInfos |
| 786 */ | 756 */ |
| 787 addExtensions: function(extensionInfos) | 757 addExtensions: function(extensionInfos) |
| 788 { | 758 { |
| 789 extensionInfos.forEach(this._addExtension, this); | 759 extensionInfos.forEach(this._addExtension, this); |
| 790 }, | 760 }, |
| 791 | 761 |
| 792 /** | 762 /** |
| 793 * @param {!ExtensionDescriptor} extensionInfo | 763 * @param {!ExtensionDescriptor} extensionInfo |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); | 1058 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); |
| 1089 } | 1059 } |
| 1090 | 1060 |
| 1091 /** | 1061 /** |
| 1092 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1062 * @typedef {{code: string, description: string, details: !Array.<*>}} |
| 1093 */ | 1063 */ |
| 1094 WebInspector.ExtensionStatus.Record; | 1064 WebInspector.ExtensionStatus.Record; |
| 1095 | 1065 |
| 1096 WebInspector.extensionAPI = {}; | 1066 WebInspector.extensionAPI = {}; |
| 1097 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1067 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
| OLD | NEW |