| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); | 73 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); |
| 74 this._durationFilter = new WebInspector.TimelineIsLongFilter(); | 74 this._durationFilter = new WebInspector.TimelineIsLongFilter(); |
| 75 this._textFilter = new WebInspector.TimelineTextFilter(); | 75 this._textFilter = new WebInspector.TimelineTextFilter(); |
| 76 | 76 |
| 77 this._model.addFilter(new WebInspector.TimelineHiddenFilter()); | 77 this._model.addFilter(new WebInspector.TimelineHiddenFilter()); |
| 78 this._model.addFilter(this._categoryFilter); | 78 this._model.addFilter(this._categoryFilter); |
| 79 this._model.addFilter(this._durationFilter); | 79 this._model.addFilter(this._durationFilter); |
| 80 this._model.addFilter(this._textFilter); | 80 this._model.addFilter(this._textFilter); |
| 81 | 81 |
| 82 this._presentationModes = [ |
| 83 WebInspector.TimelinePanel.Mode.Events, |
| 84 WebInspector.TimelinePanel.Mode.Frames, |
| 85 WebInspector.TimelinePanel.Mode.Memory |
| 86 ]; |
| 87 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled()) |
| 88 this._presentationModes.push(WebInspector.TimelinePanel.Mode.FlameChart)
; |
| 89 if (Capabilities.canProfilePower) |
| 90 this._presentationModes.push(WebInspector.TimelinePanel.Mode.Power); |
| 91 |
| 82 this._presentationModeSetting = WebInspector.settings.createSetting("timelin
eOverviewMode", WebInspector.TimelinePanel.Mode.Events); | 92 this._presentationModeSetting = WebInspector.settings.createSetting("timelin
eOverviewMode", WebInspector.TimelinePanel.Mode.Events); |
| 83 | 93 |
| 84 this._createStatusBarItems(); | 94 this._createStatusBarItems(); |
| 85 | 95 |
| 86 this._topPane = new WebInspector.SplitView(true, false); | 96 this._topPane = new WebInspector.SplitView(true, false); |
| 87 this._topPane.element.id = "timeline-overview-panel"; | 97 this._topPane.element.id = "timeline-overview-panel"; |
| 88 this._topPane.show(this.element); | 98 this._topPane.show(this.element); |
| 89 this._topPane.addEventListener(WebInspector.SplitView.Events.SidebarSizeChan
ged, this._sidebarResized, this); | 99 this._topPane.addEventListener(WebInspector.SplitView.Events.SidebarSizeChan
ged, this._sidebarResized, this); |
| 90 this._topPane.setResizable(false); | 100 this._topPane.setResizable(false); |
| 91 this._createPresentationSelector(); | 101 this._createPresentationSelector(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 { | 297 { |
| 288 this._viewsMap = {}; | 298 this._viewsMap = {}; |
| 289 | 299 |
| 290 var topPaneSidebarElement = this._topPane.sidebarElement(); | 300 var topPaneSidebarElement = this._topPane.sidebarElement(); |
| 291 topPaneSidebarElement.id = "timeline-overview-sidebar"; | 301 topPaneSidebarElement.id = "timeline-overview-sidebar"; |
| 292 | 302 |
| 293 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb
ar-tree vbox"); | 303 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb
ar-tree vbox"); |
| 294 var topPaneSidebarTree = new TreeOutline(overviewTreeElement); | 304 var topPaneSidebarTree = new TreeOutline(overviewTreeElement); |
| 295 | 305 |
| 296 this._overviewItems = {}; | 306 this._overviewItems = {}; |
| 297 for (var mode in WebInspector.TimelinePanel.Mode) { | 307 for (var i = 0; i < this._presentationModes.length; ++i) { |
| 298 if (mode === WebInspector.TimelinePanel.Mode.FlameChart && !WebInspe
ctor.experimentsSettings.timelineFlameChart.isEnabled() || | 308 var mode = this._presentationModes[i]; |
| 299 mode === WebInspector.TimelinePanel.Mode.Power && !Capabilities.
canProfilePower) | |
| 300 continue; | |
| 301 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim
eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode)); | 309 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim
eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode)); |
| 302 var item = this._overviewItems[mode]; | 310 var item = this._overviewItems[mode]; |
| 303 item.onselect = this._onModeChanged.bind(this, mode); | 311 item.onselect = this._onModeChanged.bind(this, mode); |
| 304 topPaneSidebarTree.appendChild(item); | 312 topPaneSidebarTree.appendChild(item); |
| 305 } | 313 } |
| 306 }, | 314 }, |
| 307 | 315 |
| 308 _createStatusBarItems: function() | 316 _createStatusBarItems: function() |
| 309 { | 317 { |
| 310 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); | 318 var panelStatusBarElement = this.element.createChild("div", "panel-statu
s-bar"); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 this._updateSelectionDetails(); | 559 this._updateSelectionDetails(); |
| 552 }, | 560 }, |
| 553 | 561 |
| 554 /** | 562 /** |
| 555 * @param {boolean} userInitiated | 563 * @param {boolean} userInitiated |
| 556 */ | 564 */ |
| 557 _startRecording: function(userInitiated) | 565 _startRecording: function(userInitiated) |
| 558 { | 566 { |
| 559 this._userInitiatedRecording = userInitiated; | 567 this._userInitiatedRecording = userInitiated; |
| 560 this._model.startRecording(); | 568 this._model.startRecording(); |
| 561 for (var mode in WebInspector.TimelinePanel.Mode) | 569 for (var i = 0; i < this._presentationModes.length; ++i) |
| 562 this._viewsForMode(mode).overviewView.timelineStarted(); | 570 this._viewsForMode(this._presentationModes[i]).overviewView.timeline
Started(); |
| 563 | 571 |
| 564 if (userInitiated) | 572 if (userInitiated) |
| 565 WebInspector.userMetrics.TimelineStarted.record(); | 573 WebInspector.userMetrics.TimelineStarted.record(); |
| 566 }, | 574 }, |
| 567 | 575 |
| 568 _stopRecording: function() | 576 _stopRecording: function() |
| 569 { | 577 { |
| 570 this._userInitiatedRecording = false; | 578 this._userInitiatedRecording = false; |
| 571 this._model.stopRecording(); | 579 this._model.stopRecording(); |
| 572 for (var mode in WebInspector.TimelinePanel.Mode) | 580 for (var i = 0; i < this._presentationModes.length; ++i) |
| 573 this._viewsForMode(mode).overviewView.timelineStopped(); | 581 this._viewsForMode(this._presentationModes[i]).overviewView.timeline
Stopped(); |
| 574 }, | 582 }, |
| 575 | 583 |
| 576 /** | 584 /** |
| 577 * @return {boolean} | 585 * @return {boolean} |
| 578 */ | 586 */ |
| 579 _toggleTimelineButtonClicked: function() | 587 _toggleTimelineButtonClicked: function() |
| 580 { | 588 { |
| 581 if (this._operationInProgress) | 589 if (this._operationInProgress) |
| 582 return true; | 590 return true; |
| 583 if (this._recordingInProgress()) | 591 if (this._recordingInProgress()) |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 * @param {!WebInspector.TimelineModel.Record} record | 1155 * @param {!WebInspector.TimelineModel.Record} record |
| 1148 * @return {boolean} | 1156 * @return {boolean} |
| 1149 */ | 1157 */ |
| 1150 accept: function(record) | 1158 accept: function(record) |
| 1151 { | 1159 { |
| 1152 return !this._hiddenRecords[record.type]; | 1160 return !this._hiddenRecords[record.type]; |
| 1153 }, | 1161 }, |
| 1154 | 1162 |
| 1155 __proto__: WebInspector.TimelineModel.Filter.prototype | 1163 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1156 } | 1164 } |
| OLD | NEW |