OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Timeline.TimelineLandingPage = class extends UI.VBox { | 5 Timeline.TimelineLandingPage = class extends UI.VBox { |
6 constructor() { | 6 constructor() { |
7 super(true); | 7 super(true); |
8 this.registerRequiredCSS('timeline/timelineLandingPage.css'); | 8 this.registerRequiredCSS('timeline/timelineLandingPage.css'); |
9 this.contentElement.classList.add('timeline-landing-page', 'fill'); | 9 this.contentElement.classList.add('timeline-landing-page', 'fill'); |
10 const perspectives = Timeline.TimelinePanel.Perspectives; | 10 const perspectives = Timeline.TimelinePanel.Perspectives; |
(...skipping 18 matching lines...) Expand all Loading... |
29 'Select what additional details you’d like to record. ' + | 29 'Select what additional details you’d like to record. ' + |
30 'By default, the advanced profile will collect all data of the basic pro
file.\u2002')); | 30 'By default, the advanced profile will collect all data of the basic pro
file.\u2002')); |
31 tab.appendDescription(learnMore()); | 31 tab.appendDescription(learnMore()); |
32 tab.appendOption(config.screenshots, true); | 32 tab.appendOption(config.screenshots, true); |
33 tab.appendOption(config.javascript, true); | 33 tab.appendOption(config.javascript, true); |
34 tab.appendOption(config.paints, false); | 34 tab.appendOption(config.paints, false); |
35 this._tabbedPane.appendTab(perspectives.Custom, Common.UIString('Advanced'),
tab); | 35 this._tabbedPane.appendTab(perspectives.Custom, Common.UIString('Advanced'),
tab); |
36 | 36 |
37 this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._ta
bSelected, this); | 37 this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._ta
bSelected, this); |
38 this._tabbedPane.show(this.contentElement); | 38 this._tabbedPane.show(this.contentElement); |
39 this._perspectiveSetting = | |
40 Common.settings.createSetting('timelinePerspective', Timeline.TimelinePa
nel.Perspectives.Load); | |
41 this._perspectiveSetting.addChangeListener(this._perspectiveChanged, this); | |
42 | 39 |
43 /** | 40 /** |
44 * @return {!Element} | 41 * @return {!Element} |
45 */ | 42 */ |
46 function learnMore() { | 43 function learnMore() { |
47 return UI.createExternalLink( | 44 return UI.createExternalLink( |
48 'https://developers.google.com/web/tools/chrome-devtools/evaluate-perfor
mance/timeline-tool', | 45 'https://developers.google.com/web/tools/chrome-devtools/evaluate-perfor
mance/', |
49 Common.UIString('Learn more')); | 46 Common.UIString('Learn more')); |
50 } | 47 } |
51 } | 48 } |
52 | 49 |
53 /** | 50 _tabSelected() { |
54 * @param {!Common.Event} event | |
55 */ | |
56 _tabSelected(event) { | |
57 if (this._perspectiveSetting.get() !== event.data.tabId) | |
58 this._perspectiveSetting.set(event.data.tabId); | |
59 } | |
60 | |
61 _perspectiveChanged() { | |
62 this._tabbedPane.selectTab(this._perspectiveSetting.get()); | |
63 const tabWidget = /** @type {!Timeline.TimelineLandingPage.PerspectiveTabWid
get} */ (this._tabbedPane.visibleView); | 51 const tabWidget = /** @type {!Timeline.TimelineLandingPage.PerspectiveTabWid
get} */ (this._tabbedPane.visibleView); |
64 tabWidget.activate(); | 52 tabWidget.activate(); |
65 } | 53 } |
66 }; | 54 }; |
67 | 55 |
68 /** @typedef {!{id: string, title: string, description: string, setting: string}
} */ | 56 /** @typedef {!{id: string, title: string, description: string, setting: string}
} */ |
69 Timeline.TimelineLandingPage.RecordingOption; | 57 Timeline.TimelineLandingPage.RecordingOption; |
70 | 58 |
71 /** @type {!Object<string, !Timeline.TimelineLandingPage.RecordingOption>} */ | 59 /** @type {!Object<string, !Timeline.TimelineLandingPage.RecordingOption>} */ |
72 Timeline.TimelineLandingPage.RecordingConfig = { | 60 Timeline.TimelineLandingPage.RecordingConfig = { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 127 } |
140 | 128 |
141 _record() { | 129 _record() { |
142 UI.actionRegistry.action('timeline.toggle-recording').execute(); | 130 UI.actionRegistry.action('timeline.toggle-recording').execute(); |
143 } | 131 } |
144 | 132 |
145 _recordPageLoad() { | 133 _recordPageLoad() { |
146 SDK.targetManager.reloadPage(); | 134 SDK.targetManager.reloadPage(); |
147 } | 135 } |
148 }; | 136 }; |
OLD | NEW |