| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * @constructor | 33 * @constructor |
| 34 * @extends {WebInspector.Panel} | 34 * @extends {WebInspector.Panel} |
| 35 * @implements {WebInspector.TimelineModeViewDelegate} | 35 * @implements {WebInspector.TimelineModeViewDelegate} |
| 36 * @implements {WebInspector.Searchable} | 36 * @implements {WebInspector.Searchable} |
| 37 * @implements {WebInspector.TargetManager.Observer} |
| 37 */ | 38 */ |
| 38 WebInspector.TimelinePanel = function() | 39 WebInspector.TimelinePanel = function() |
| 39 { | 40 { |
| 40 WebInspector.Panel.call(this, "timeline"); | 41 WebInspector.Panel.call(this, "timeline"); |
| 41 this.registerRequiredCSS("timelinePanel.css"); | 42 this.registerRequiredCSS("timelinePanel.css"); |
| 42 this.registerRequiredCSS("layersPanel.css"); | 43 this.registerRequiredCSS("layersPanel.css"); |
| 43 this.registerRequiredCSS("filter.css"); | 44 this.registerRequiredCSS("filter.css"); |
| 44 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f
alse); | 45 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f
alse); |
| 45 | 46 |
| 46 this._detailsLinkifier = new WebInspector.Linkifier(); | 47 this._detailsLinkifier = new WebInspector.Linkifier(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 this._stackView = new WebInspector.StackView(false); | 117 this._stackView = new WebInspector.StackView(false); |
| 117 this._stackView.show(this._searchableView.element); | 118 this._stackView.show(this._searchableView.element); |
| 118 this._stackView.element.classList.add("timeline-view-stack"); | 119 this._stackView.element.classList.add("timeline-view-stack"); |
| 119 | 120 |
| 120 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve
nts.DockSideChanged, this._dockSideChanged.bind(this)); | 121 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve
nts.DockSideChanged, this._dockSideChanged.bind(this)); |
| 121 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi
s._dockSideChanged.bind(this)); | 122 WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(thi
s._dockSideChanged.bind(this)); |
| 122 this._dockSideChanged(); | 123 this._dockSideChanged(); |
| 123 | 124 |
| 124 this._onModeChanged(); | 125 this._onModeChanged(); |
| 125 this._detailsSplitView.show(this.element); | 126 this._detailsSplitView.show(this.element); |
| 126 WebInspector.profilingLock.addEventListener(WebInspector.Lock.Events.StateCh
anged, this._onProfilingStateChanged, this); | |
| 127 } | 127 } |
| 128 | 128 |
| 129 WebInspector.TimelinePanel.OverviewMode = { | 129 WebInspector.TimelinePanel.OverviewMode = { |
| 130 Events: "Events", | 130 Events: "Events", |
| 131 Frames: "Frames" | 131 Frames: "Frames" |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // Define row and header height, should be in sync with styles for timeline grap
hs. | 134 // Define row and header height, should be in sync with styles for timeline grap
hs. |
| 135 WebInspector.TimelinePanel.rowHeight = 18; | 135 WebInspector.TimelinePanel.rowHeight = 18; |
| 136 WebInspector.TimelinePanel.headerHeight = 20; | 136 WebInspector.TimelinePanel.headerHeight = 20; |
| 137 | 137 |
| 138 WebInspector.TimelinePanel.durationFilterPresetsMs = [0, 1, 15]; | 138 WebInspector.TimelinePanel.durationFilterPresetsMs = [0, 1, 15]; |
| 139 | 139 |
| 140 WebInspector.TimelinePanel.prototype = { | 140 WebInspector.TimelinePanel.prototype = { |
| 141 /** | 141 /** |
| 142 * @param {!WebInspector.Target} target |
| 143 */ |
| 144 targetAdded: function(target) |
| 145 { |
| 146 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChan
ged, this._onProfilingStateChanged, this); |
| 147 }, |
| 148 |
| 149 /** |
| 150 * @param {!WebInspector.Target} target |
| 151 */ |
| 152 targetRemoved: function(target) |
| 153 { |
| 154 target.profilingLock.removeEventListener(WebInspector.Lock.Events.StateC
hanged, this._onProfilingStateChanged, this); |
| 155 }, |
| 156 |
| 157 /** |
| 142 * @return {?WebInspector.SearchableView} | 158 * @return {?WebInspector.SearchableView} |
| 143 */ | 159 */ |
| 144 searchableView: function() | 160 searchableView: function() |
| 145 { | 161 { |
| 146 return this._searchableView; | 162 return this._searchableView; |
| 147 }, | 163 }, |
| 148 | 164 |
| 149 wasShown: function() | 165 wasShown: function() |
| 150 { | 166 { |
| 151 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { | 167 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 _onProfilingStateChanged: function() | 683 _onProfilingStateChanged: function() |
| 668 { | 684 { |
| 669 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 685 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
| 670 }, | 686 }, |
| 671 | 687 |
| 672 /** | 688 /** |
| 673 * @param {boolean} toggled | 689 * @param {boolean} toggled |
| 674 */ | 690 */ |
| 675 _updateToggleTimelineButton: function(toggled) | 691 _updateToggleTimelineButton: function(toggled) |
| 676 { | 692 { |
| 677 var isAcquiredInSomeTarget = WebInspector.profilingLock.isAcquired(); | 693 var isAcquiredInSomeTarget = WebInspector.targetManager.targets().some(f
unction(target) { return target.profilingLock.isAcquired(); }); |
| 678 this.toggleTimelineButton.toggled = toggled; | 694 this.toggleTimelineButton.toggled = toggled; |
| 679 if (toggled) { | 695 if (toggled) { |
| 680 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); | 696 this.toggleTimelineButton.title = WebInspector.UIString("Stop"); |
| 681 this.toggleTimelineButton.setEnabled(true); | 697 this.toggleTimelineButton.setEnabled(true); |
| 682 } else if (this._stopPending) { | 698 } else if (this._stopPending) { |
| 683 this.toggleTimelineButton.title = WebInspector.UIString("Stop pendin
g"); | 699 this.toggleTimelineButton.title = WebInspector.UIString("Stop pendin
g"); |
| 684 this.toggleTimelineButton.setEnabled(false); | 700 this.toggleTimelineButton.setEnabled(false); |
| 685 } else if (isAcquiredInSomeTarget) { | 701 } else if (isAcquiredInSomeTarget) { |
| 686 this.toggleTimelineButton.title = WebInspector.anotherProfilerActive
Label(); | 702 this.toggleTimelineButton.title = WebInspector.anotherProfilerActive
Label(); |
| 687 this.toggleTimelineButton.setEnabled(false); | 703 this.toggleTimelineButton.setEnabled(false); |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 * @param {!WebInspector.TimelineModel.Record} record | 1426 * @param {!WebInspector.TimelineModel.Record} record |
| 1411 * @return {boolean} | 1427 * @return {boolean} |
| 1412 */ | 1428 */ |
| 1413 accept: function(record) | 1429 accept: function(record) |
| 1414 { | 1430 { |
| 1415 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); | 1431 return !this._regex || this._uiUtils.testContentMatching(record, this._r
egex); |
| 1416 }, | 1432 }, |
| 1417 | 1433 |
| 1418 __proto__: WebInspector.TimelineModel.Filter.prototype | 1434 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1419 } | 1435 } |
| OLD | NEW |