Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
| index 61fe3f9314e7d7b23258fe557b9697d30898c70a..a790416f8b95905f84a6840ac9c70a0709bb9422 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js |
| @@ -83,16 +83,16 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| this._panelToolbar = new UI.Toolbar('', this.element); |
| - var timelinePane = new UI.VBox(); |
| - timelinePane.show(this.element); |
| - var topPaneElement = timelinePane.element.createChild('div', 'hbox'); |
| + this._timelinePane = new UI.VBox(); |
| + this._timelinePane.show(this.element); |
| + var topPaneElement = this._timelinePane.element.createChild('div', 'hbox'); |
| topPaneElement.id = 'timeline-overview-panel'; |
| // Create top overview component. |
| this._overviewPane = new UI.TimelineOverviewPane('timeline'); |
| this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged.bind(this)); |
| this._overviewPane.show(topPaneElement); |
| - this._statusPaneContainer = timelinePane.element.createChild('div', 'status-pane-container fill'); |
| + this._statusPaneContainer = this._timelinePane.element.createChild('div', 'status-pane-container fill'); |
| this._createFileSelector(); |
| @@ -122,7 +122,7 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| this._captureMemorySetting.addChangeListener(this._onModeChanged, this); |
| this._captureFilmStripSetting.addChangeListener(this._onModeChanged, this); |
| - this._detailsSplitWidget.show(timelinePane.element); |
| + this._detailsSplitWidget.show(this._timelinePane.element); |
| this._detailsSplitWidget.hideSidebar(); |
| SDK.targetManager.addEventListener(SDK.TargetManager.Events.SuspendStateChanged, this._onSuspendStateChanged, this); |
| this._showRecordingHelpMessage(); |
| @@ -423,15 +423,9 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| cpuThrottlingCombobox.select(option); |
| hasSelection = true; |
| } |
| - var predefinedRates = new Map([ |
| - [1, Common.UIString('No CPU throttling')], |
| - [2, Common.UIString('2\xD7 slowdown')], |
| - [5, Common.UIString('5\xD7 slowdown')], |
| - [10, Common.UIString('10\xD7 slowdown')], |
| - [20, Common.UIString('20\xD7 slowdown')] |
| - ]); |
| - for (var rate of predefinedRates) |
| - addGroupingOption(rate[1], rate[0]); |
| + addGroupingOption(Common.UIString('No CPU throttling'), 1); |
| + for (const rate of [2, 5, 10, 20]) |
| + addGroupingOption(Common.UIString('%d\xD7 slowdown', rate), rate); |
| } |
| _prepareToLoadTimeline() { |
| @@ -585,6 +579,7 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| var mainTarget = SDK.targetManager.mainTarget(); |
| if (!mainTarget) |
| return; |
| + this._clear(); |
|
caseq
2016/12/12 18:51:53
I don't think this should be here.
alph
2016/12/12 20:43:13
Done.
|
| this._setState(Timeline.TimelinePanel.State.StartPending); |
| this._showRecordingStarted(); |
| @@ -659,10 +654,8 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| this._frameModel.reset(); |
| this._filmStripModel.reset(this._tracingModel); |
| this._overviewPane.reset(); |
| - for (var i = 0; i < this._currentViews.length; ++i) |
| - this._currentViews[i].reset(); |
| - for (var i = 0; i < this._overviewControls.length; ++i) |
| - this._overviewControls[i].reset(); |
| + this._currentViews.forEach(view => view.reset()); |
| + this._overviewControls.forEach(overview => overview.reset()); |
| this.select(null); |
| this._detailsSplitWidget.hideSidebar(); |
| } |
| @@ -671,7 +664,6 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| * @override |
| */ |
| recordingStarted() { |
| - this._clear(); |
| this._setState(Timeline.TimelinePanel.State.Recording); |
| this._showRecordingStarted(); |
| this._statusPane.updateStatus(Common.UIString('Recording\u2026')); |
| @@ -689,6 +681,11 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| } |
| _showRecordingHelpMessage() { |
| + if (Runtime.experiments.isEnabled('timelineLandingPage')) { |
| + this._showLandingPage(); |
| + return; |
| + } |
| + |
| /** |
| * @param {string} tagName |
| * @param {string} contents |
| @@ -723,11 +720,31 @@ Timeline.TimelinePanel = class extends UI.Panel { |
| } |
| _hideRecordingHelpMessage() { |
| + if (Runtime.experiments.isEnabled('timelineLandingPage')) { |
| + this._hideLandingPage(); |
| + return; |
| + } |
| if (this._helpMessageElement) |
| this._helpMessageElement.remove(); |
| delete this._helpMessageElement; |
| } |
| + _showLandingPage() { |
| + if (this._landingPage) |
| + return; |
| + this._detailsSplitWidget.detach(); |
| + this._landingPage = new Timeline.TimelineLandingPage(); |
| + this._landingPage.show(this._timelinePane.element); |
| + } |
| + |
| + _hideLandingPage() { |
| + if (!this._landingPage) |
| + return; |
| + this._landingPage.detach(); |
| + this._landingPage = null; |
| + this._detailsSplitWidget.show(this._timelinePane.element); |
| + } |
| + |
| /** |
| * @override |
| */ |