Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 1178563002: DevTools: Refactor network panel overview (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update test. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
72 this._currentViews = []; 72 this._currentViews = [];
73 73
74 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Frames); 74 this._overviewModeSetting = WebInspector.settings.createSetting("timelineOve rviewMode", WebInspector.TimelinePanel.OverviewMode.Frames);
75 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli neFlameChartEnabled", true); 75 this._flameChartEnabledSetting = WebInspector.settings.createSetting("timeli neFlameChartEnabled", true);
76 this._createToolbarItems(); 76 this._createToolbarItems();
77 77
78 var topPaneElement = this.element.createChild("div", "hbox"); 78 var topPaneElement = this.element.createChild("div", "hbox");
79 topPaneElement.id = "timeline-overview-panel"; 79 topPaneElement.id = "timeline-overview-panel";
80 80
81 // Create top overview component. 81 // Create top overview component.
82 this._overviewPane = new WebInspector.TimelineOverviewPane(); 82 this._overviewPane = new WebInspector.TimelineOverviewPane("timeline");
83 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .SelectionChanged, this._onOverviewSelectionChanged.bind(this));
84 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this)); 83 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this));
85 this._overviewPane.show(topPaneElement); 84 this._overviewPane.show(topPaneElement);
86 85
87 this._createFileSelector(); 86 this._createFileSelector();
88 this._registerShortcuts(); 87 this._registerShortcuts();
89 88
90 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.WillReloadPage, this._willReloadPage, this); 89 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.WillReloadPage, this._willReloadPage, this);
91 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.Load, this._loadEventFired, this); 90 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.Load, this._loadEventFired, this);
92 91
93 // Create top level properties splitter. 92 // Create top level properties splitter.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 }, 596 },
598 597
599 _onModeChanged: function() 598 _onModeChanged: function()
600 { 599 {
601 this._stackView.detach(); 600 this._stackView.detach();
602 601
603 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel inePanel.OverviewMode.Frames; 602 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel inePanel.OverviewMode.Frames;
604 this._removeAllModeViews(); 603 this._removeAllModeViews();
605 this._overviewControls = []; 604 this._overviewControls = [];
606 605
607 var mainOverview = isFrameMode ? new WebInspector.TimelineFrameOverview( this._model, this._frameModel()) 606 if (isFrameMode) {
608 : new WebInspector.TimelineEventOverview( this._model, this._frameModel()); 607 this._frameOverview = new WebInspector.TimelineFrameOverview(this._m odel, this._frameModel());
609 this._overviewControls.push(mainOverview); 608 this._frameOverview.addEventListener(WebInspector.TimelineFrameOverv iew.Events.SelectionChanged, this._onOverviewSelectionChanged, this);
609 this._overviewControls.push(this._frameOverview);
610 } else {
611 this._frameOverview = null;
612 this._overviewControls.push(new WebInspector.TimelineEventOverview(t his._model, this._frameModel()));
613 }
610 this.element.classList.toggle("timeline-overview-frames-mode", isFrameMo de); 614 this.element.classList.toggle("timeline-overview-frames-mode", isFrameMo de);
611 615
612 if (this._flameChartEnabledSetting.get()) { 616 if (this._flameChartEnabledSetting.get()) {
613 this._filterBar.filterButton().setEnabled(false); 617 this._filterBar.filterButton().setEnabled(false);
614 this._filtersContainer.classList.toggle("hidden", true); 618 this._filtersContainer.classList.toggle("hidden", true);
615 this._flameChart = new WebInspector.TimelineFlameChartView(this, thi s._model, this._frameModel()); 619 this._flameChart = new WebInspector.TimelineFlameChartView(this, thi s._model, this._frameModel());
616 this._flameChart.enableNetworkPane(this._captureNetworkSetting.get() ); 620 this._flameChart.enableNetworkPane(this._captureNetworkSetting.get() );
617 this._addModeView(this._flameChart); 621 this._addModeView(this._flameChart);
618 } else { 622 } else {
619 this._flameChart = null; 623 this._flameChart = null;
620 this._filterBar.filterButton().setEnabled(true); 624 this._filterBar.filterButton().setEnabled(true);
621 this._filtersContainer.classList.toggle("hidden", !this._filterBar.f iltersToggled()); 625 this._filtersContainer.classList.toggle("hidden", !this._filterBar.f iltersToggled());
622 var timelineView = new WebInspector.TimelineView(this, this._model); 626 var timelineView = new WebInspector.TimelineView(this, this._model);
623 this._addModeView(timelineView); 627 this._addModeView(timelineView);
624 timelineView.setFrameModel(isFrameMode ? this._frameModel() : null); 628 timelineView.setFrameModel(isFrameMode ? this._frameModel() : null);
625 } 629 }
626 630
627 if (this._captureMemorySetting.get()) { 631 if (this._captureMemorySetting.get()) {
628 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews. 632 if (!isFrameMode) // Frame mode skews time, don't render aux overvi ews.
629 this._overviewControls.push(new WebInspector.TimelineMemoryOverv iew(this._model)); 633 this._overviewControls.push(new WebInspector.TimelineMemoryOverv iew(this._model));
630 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m odel)); 634 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m odel));
631 } 635 }
632 636
633 if (Runtime.experiments.isEnabled("filmStripInNetworkAndTimeline") && !i sFrameMode && this._captureFilmStripSetting.get()) 637 if (Runtime.experiments.isEnabled("filmStripInNetworkAndTimeline") && !i sFrameMode && this._captureFilmStripSetting.get())
634 this._overviewControls.push(new WebInspector.TimelineFilmStripOvervi ew(this._model, this._tracingModel)); 638 this._overviewControls.push(new WebInspector.TimelineFilmStripOvervi ew(this._tracingModel));
635 639
636 var mainTarget = WebInspector.targetManager.mainTarget(); 640 var mainTarget = WebInspector.targetManager.mainTarget();
637 this._overviewPane.setOverviewControls(this._overviewControls); 641 this._overviewPane.setOverviewControls(this._overviewControls);
638 this.doResize(); 642 this.doResize();
639 this._selection = null; 643 this._selection = null;
640 this._updateSelectionDetails(); 644 this._updateSelectionDetails();
641 645
642 this._stackView.show(this._searchableView.element); 646 this._stackView.show(this._searchableView.element);
643 }, 647 },
644 648
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 { 1230 {
1227 this._detailsLinkifier.reset(); 1231 this._detailsLinkifier.reset();
1228 this._selection = selection; 1232 this._selection = selection;
1229 if (preferredTab) 1233 if (preferredTab)
1230 this._detailsView.setPreferredTab(preferredTab); 1234 this._detailsView.setPreferredTab(preferredTab);
1231 1235
1232 for (var i = 0; i < this._currentViews.length; ++i) { 1236 for (var i = 0; i < this._currentViews.length; ++i) {
1233 var view = this._currentViews[i]; 1237 var view = this._currentViews[i];
1234 view.setSelection(selection); 1238 view.setSelection(selection);
1235 } 1239 }
1236 this._overviewPane.select(selection); 1240 if (this._frameOverview)
1241 this._frameOverview.select(selection);
1237 this._updateSelectionDetails(); 1242 this._updateSelectionDetails();
1238 }, 1243 },
1239 1244
1240 /** 1245 /**
1241 * @param {number} startTime 1246 * @param {number} startTime
1242 * @param {number} endTime 1247 * @param {number} endTime
1243 */ 1248 */
1244 _revealTimeRange: function(startTime, endTime) 1249 _revealTimeRange: function(startTime, endTime)
1245 { 1250 {
1246 var timeShift = 0; 1251 var timeShift = 0;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 handleQueryParam: function(value) 1811 handleQueryParam: function(value)
1807 { 1812 {
1808 WebInspector.TimelinePanel.show(); 1813 WebInspector.TimelinePanel.show();
1809 WebInspector.TimelinePanel.instance()._loadFromURL(value); 1814 WebInspector.TimelinePanel.instance()._loadFromURL(value);
1810 } 1815 }
1811 } 1816 }
1812 1817
1813 /** 1818 /**
1814 * @constructor 1819 * @constructor
1815 * @extends {WebInspector.TimelineOverviewBase} 1820 * @extends {WebInspector.TimelineOverviewBase}
1816 * @param {!WebInspector.TimelineModel} model
1817 * @param {!WebInspector.TracingModel} tracingModel 1821 * @param {!WebInspector.TracingModel} tracingModel
1818 */ 1822 */
1819 WebInspector.TimelineFilmStripOverview = function(model, tracingModel) 1823 WebInspector.TimelineFilmStripOverview = function(tracingModel)
1820 { 1824 {
1821 WebInspector.TimelineOverviewBase.call(this, model); 1825 WebInspector.TimelineOverviewBase.call(this);
1822 this._tracingModel = tracingModel; 1826 this._tracingModel = tracingModel;
1823 this._filmStripView = new WebInspector.FilmStripView(); 1827 this._filmStripView = new WebInspector.FilmStripView();
1824 this._filmStripView.show(this.element); 1828 this._filmStripView.show(this.element);
1825 } 1829 }
1826 1830
1827 WebInspector.TimelineFilmStripOverview.prototype = { 1831 WebInspector.TimelineFilmStripOverview.prototype = {
1828 /** 1832 /**
1829 * @override 1833 * @override
1830 */ 1834 */
1831 update: function() 1835 update: function()
1832 { 1836 {
1833 var model = this._tracingModel; 1837 var model = this._tracingModel;
1834 this._filmStripModel = new WebInspector.FilmStripModel(model); 1838 this._filmStripModel = new WebInspector.FilmStripModel(model);
1835 this._filmStripView.setModel(this._filmStripModel, model.minimumRecordTi me(), model.maximumRecordTime() - model.minimumRecordTime()); 1839 this._filmStripView.setModel(this._filmStripModel, model.minimumRecordTi me(), model.maximumRecordTime() - model.minimumRecordTime());
1836 }, 1840 },
1837 1841
1838 /** 1842 /**
1839 * @override 1843 * @override
1840 */ 1844 */
1841 reset: function() 1845 reset: function()
1842 { 1846 {
1843 this._filmStripView.reset(); 1847 this._filmStripView.reset();
1844 }, 1848 },
1845 1849
1846 __proto__: WebInspector.TimelineOverviewBase.prototype 1850 __proto__: WebInspector.TimelineOverviewBase.prototype
1847 } 1851 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineOverviewPane.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698