Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 this._captureJSProfileSetting = Common.settings.createSetting('timelineEnabl eJSSampling', true); | 77 this._captureJSProfileSetting = Common.settings.createSetting('timelineEnabl eJSSampling', true); |
| 78 this._captureMemorySetting = Common.settings.createSetting('timelineCaptureM emory', false); | 78 this._captureMemorySetting = Common.settings.createSetting('timelineCaptureM emory', false); |
| 79 this._captureLayersAndPicturesSetting = Common.settings.createSetting('timel ineCaptureLayersAndPictures', false); | 79 this._captureLayersAndPicturesSetting = Common.settings.createSetting('timel ineCaptureLayersAndPictures', false); |
| 80 this._captureFilmStripSetting = Common.settings.createSetting('timelineCaptu reFilmStrip', false); | 80 this._captureFilmStripSetting = Common.settings.createSetting('timelineCaptu reFilmStrip', false); |
| 81 | 81 |
| 82 this._markUnusedCSS = Common.settings.createSetting('timelineMarkUnusedCSS', false); | 82 this._markUnusedCSS = Common.settings.createSetting('timelineMarkUnusedCSS', false); |
| 83 | 83 |
| 84 this._panelToolbar = new UI.Toolbar('', this.element); | 84 this._panelToolbar = new UI.Toolbar('', this.element); |
| 85 | 85 |
| 86 var timelinePane = new UI.VBox(); | 86 var timelinePane = new UI.VBox(); |
| 87 this._timelinePane = timelinePane; | |
|
caseq
2016/12/07 20:17:29
let's get rid of local var for simplicity.
alph
2016/12/08 07:22:45
Done.
| |
| 87 timelinePane.show(this.element); | 88 timelinePane.show(this.element); |
| 88 var topPaneElement = timelinePane.element.createChild('div', 'hbox'); | 89 var topPaneElement = timelinePane.element.createChild('div', 'hbox'); |
| 89 topPaneElement.id = 'timeline-overview-panel'; | 90 topPaneElement.id = 'timeline-overview-panel'; |
| 90 | 91 |
| 91 // Create top overview component. | 92 // Create top overview component. |
| 92 this._overviewPane = new UI.TimelineOverviewPane('timeline'); | 93 this._overviewPane = new UI.TimelineOverviewPane('timeline'); |
| 93 this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowCha nged, this._onWindowChanged.bind(this)); | 94 this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowCha nged, this._onWindowChanged.bind(this)); |
| 94 this._overviewPane.show(topPaneElement); | 95 this._overviewPane.show(topPaneElement); |
| 95 this._statusPaneContainer = timelinePane.element.createChild('div', 'status- pane-container fill'); | 96 this._statusPaneContainer = timelinePane.element.createChild('div', 'status- pane-container fill'); |
| 96 | 97 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 653 Components.LineLevelProfile.instance().reset(); | 654 Components.LineLevelProfile.instance().reset(); |
| 654 this._tracingModel.reset(); | 655 this._tracingModel.reset(); |
| 655 this._model.reset(); | 656 this._model.reset(); |
| 656 this._showRecordingHelpMessage(); | 657 this._showRecordingHelpMessage(); |
| 657 | 658 |
| 658 this.requestWindowTimes(0, Infinity); | 659 this.requestWindowTimes(0, Infinity); |
| 659 delete this._selection; | 660 delete this._selection; |
| 660 this._frameModel.reset(); | 661 this._frameModel.reset(); |
| 661 this._filmStripModel.reset(this._tracingModel); | 662 this._filmStripModel.reset(this._tracingModel); |
| 662 this._overviewPane.reset(); | 663 this._overviewPane.reset(); |
| 663 for (var i = 0; i < this._currentViews.length; ++i) | 664 this._currentViews.forEach(view => view.reset()); |
| 664 this._currentViews[i].reset(); | 665 this._overviewControls.forEach(overview => overview.reset()); |
| 665 for (var i = 0; i < this._overviewControls.length; ++i) | |
| 666 this._overviewControls[i].reset(); | |
| 667 this.select(null); | 666 this.select(null); |
| 668 this._detailsSplitWidget.hideSidebar(); | 667 this._detailsSplitWidget.hideSidebar(); |
| 669 } | 668 } |
| 670 | 669 |
| 671 /** | 670 /** |
| 672 * @override | 671 * @override |
| 673 */ | 672 */ |
| 674 recordingStarted() { | 673 recordingStarted() { |
| 675 this._clear(); | 674 this._clear(); |
| 676 this._setState(Timeline.TimelinePanel.State.Recording); | 675 this._setState(Timeline.TimelinePanel.State.Recording); |
| 677 this._showRecordingStarted(); | 676 this._showRecordingStarted(); |
| 678 this._statusPane.updateStatus(Common.UIString('Recording\u2026')); | 677 this._statusPane.updateStatus(Common.UIString('Recording\u2026')); |
| 679 this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), 0); | 678 this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), 0); |
| 680 this._statusPane.startTimer(); | 679 this._statusPane.startTimer(); |
| 681 this._hideRecordingHelpMessage(); | 680 this._hideRecordingHelpMessage(); |
| 682 } | 681 } |
| 683 | 682 |
| 684 /** | 683 /** |
| 685 * @override | 684 * @override |
| 686 * @param {number} usage | 685 * @param {number} usage |
| 687 */ | 686 */ |
| 688 recordingProgress(usage) { | 687 recordingProgress(usage) { |
| 689 this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), usage * 100); | 688 this._statusPane.updateProgressBar(Common.UIString('Buffer usage'), usage * 100); |
| 690 } | 689 } |
| 691 | 690 |
| 692 _showRecordingHelpMessage() { | 691 _showRecordingHelpMessage() { |
| 692 if (Runtime.experiments.isEnabled('timelineLandingPage')) { | |
| 693 this._showLandingPage(); | |
| 694 return; | |
| 695 } | |
| 696 | |
| 693 /** | 697 /** |
| 694 * @param {string} tagName | 698 * @param {string} tagName |
| 695 * @param {string} contents | 699 * @param {string} contents |
| 696 * @return {!Element} | 700 * @return {!Element} |
| 697 */ | 701 */ |
| 698 function encloseWithTag(tagName, contents) { | 702 function encloseWithTag(tagName, contents) { |
| 699 var e = createElement(tagName); | 703 var e = createElement(tagName); |
| 700 e.textContent = contents; | 704 e.textContent = contents; |
| 701 return e; | 705 return e; |
| 702 } | 706 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 717 hintText.createChild('br'); | 721 hintText.createChild('br'); |
| 718 hintText.appendChild( | 722 hintText.appendChild( |
| 719 UI.formatLocalized('Then, zoom and pan the timeline with the mousewheel and %s keys.', [navigateNode])); | 723 UI.formatLocalized('Then, zoom and pan the timeline with the mousewheel and %s keys.', [navigateNode])); |
| 720 this._hideRecordingHelpMessage(); | 724 this._hideRecordingHelpMessage(); |
| 721 this._helpMessageElement = | 725 this._helpMessageElement = |
| 722 this._searchableView.element.createChild('div', 'full-widget-dimmed-bann er timeline-status-pane'); | 726 this._searchableView.element.createChild('div', 'full-widget-dimmed-bann er timeline-status-pane'); |
| 723 this._helpMessageElement.appendChild(hintText); | 727 this._helpMessageElement.appendChild(hintText); |
| 724 } | 728 } |
| 725 | 729 |
| 726 _hideRecordingHelpMessage() { | 730 _hideRecordingHelpMessage() { |
| 731 if (Runtime.experiments.isEnabled('timelineLandingPage')) { | |
| 732 this._hideLandingPage(); | |
| 733 return; | |
| 734 } | |
| 727 if (this._helpMessageElement) | 735 if (this._helpMessageElement) |
| 728 this._helpMessageElement.remove(); | 736 this._helpMessageElement.remove(); |
| 729 delete this._helpMessageElement; | 737 delete this._helpMessageElement; |
| 730 } | 738 } |
| 731 | 739 |
| 740 _showLandingPage() { | |
| 741 if (this._landingPage) | |
| 742 return; | |
| 743 this._landingPage = new Timeline.LandingPage(); | |
| 744 this._landingPage.show(this._timelinePane.element); | |
| 745 this._detailsSplitWidget.detach(); | |
| 746 } | |
| 747 | |
| 748 _hideLandingPage() { | |
| 749 if (!this._landingPage) | |
| 750 return; | |
| 751 this._landingPage.dispose(); | |
| 752 this._landingPage.detach(); | |
| 753 this._landingPage = null; | |
| 754 this._detailsSplitWidget.show(this._timelinePane.element); | |
| 755 } | |
| 756 | |
| 732 /** | 757 /** |
| 733 * @override | 758 * @override |
| 734 */ | 759 */ |
| 735 loadingStarted() { | 760 loadingStarted() { |
| 736 this._hideRecordingHelpMessage(); | 761 this._hideRecordingHelpMessage(); |
| 737 | 762 |
| 738 if (this._statusPane) | 763 if (this._statusPane) |
| 739 this._statusPane.hide(); | 764 this._statusPane.hide(); |
| 740 this._statusPane = new Timeline.TimelinePanel.StatusPane(false, this._cancel Loading.bind(this)); | 765 this._statusPane = new Timeline.TimelinePanel.StatusPane(false, this._cancel Loading.bind(this)); |
| 741 this._statusPane.showPane(this._statusPaneContainer); | 766 this._statusPane.showPane(this._statusPaneContainer); |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1958 } | 1983 } |
| 1959 | 1984 |
| 1960 /** | 1985 /** |
| 1961 * @override | 1986 * @override |
| 1962 * @param {!SDK.Target} target | 1987 * @param {!SDK.Target} target |
| 1963 */ | 1988 */ |
| 1964 targetRemoved(target) { | 1989 targetRemoved(target) { |
| 1965 this._targets.remove(target, true); | 1990 this._targets.remove(target, true); |
| 1966 } | 1991 } |
| 1967 }; | 1992 }; |
| OLD | NEW |