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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js

Issue 2640403003: Fix UI glitches on Performance and Memory panels (Closed)
Patch Set: fix flamechart panning bug Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Timeline.TimelineTreeView = class extends UI.VBox { 7 Timeline.TimelineTreeView = class extends UI.VBox {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this.element.classList.add('timeline-tree-view'); 10 this.element.classList.add('timeline-tree-view');
(...skipping 14 matching lines...) Expand all
25 /** 25 /**
26 * @param {!TimelineModel.TimelineModel} model 26 * @param {!TimelineModel.TimelineModel} model
27 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters 27 * @param {!Array<!TimelineModel.TimelineModel.Filter>} filters
28 */ 28 */
29 _init(model, filters) { 29 _init(model, filters) {
30 this._model = model; 30 this._model = model;
31 this._linkifier = new Components.Linkifier(); 31 this._linkifier = new Components.Linkifier();
32 32
33 this._filters = filters.slice(); 33 this._filters = filters.slice();
34 34
35 var columns = /** @type {!Array<!DataGrid.DataGrid.ColumnDescriptor>} */ ([] ); 35 const columns = /** @type {!Array<!DataGrid.DataGrid.ColumnDescriptor>} */ ( []);
36 this._populateColumns(columns); 36 this._populateColumns(columns);
37 37
38 var mainView = new UI.VBox(); 38 this._splitWidget = new UI.SplitWidget(true, true, 'timelineTreeViewDetailsS plitWidget');
39 const mainView = new UI.VBox();
39 this._populateToolbar(mainView.element); 40 this._populateToolbar(mainView.element);
41
40 this._dataGrid = new DataGrid.SortableDataGrid(columns); 42 this._dataGrid = new DataGrid.SortableDataGrid(columns);
41 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SortingChanged, thi s._sortingChanged, this); 43 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SortingChanged, thi s._sortingChanged, this);
42 this._dataGrid.element.addEventListener('mousemove', this._onMouseMove.bind( this), true); 44 this._dataGrid.element.addEventListener('mousemove', this._onMouseMove.bind( this), true);
43 this._dataGrid.setResizeMethod(DataGrid.DataGrid.ResizeMethod.Last); 45 this._dataGrid.setResizeMethod(DataGrid.DataGrid.ResizeMethod.Last);
44 this._dataGrid.setRowContextMenuCallback(this._onContextMenu.bind(this)); 46 this._dataGrid.setRowContextMenuCallback(this._onContextMenu.bind(this));
45 this._dataGrid.asWidget().show(mainView.element); 47 this._dataGrid.asWidget().show(mainView.element);
46 48 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SelectedNode, this. _updateDetailsForSelection, this);
47 this._splitWidget = new UI.SplitWidget(true, true, 'timelineTreeViewDetailsS plitWidget');
48 this._splitWidget.show(this.element);
49 this._splitWidget.setMainWidget(mainView);
50 49
51 this._detailsView = new UI.VBox(); 50 this._detailsView = new UI.VBox();
52 this._detailsView.element.classList.add('timeline-details-view', 'timeline-d etails-view-body'); 51 this._detailsView.element.classList.add('timeline-details-view', 'timeline-d etails-view-body');
52 this._splitWidget.setMainWidget(mainView);
53 this._splitWidget.setSidebarWidget(this._detailsView); 53 this._splitWidget.setSidebarWidget(this._detailsView);
54 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SelectedNode, this. _updateDetailsForSelection, this); 54 this._splitWidget.hideSidebar();
55 this._splitWidget.show(this.element);
55 56
56 /** @type {?TimelineModel.TimelineProfileTree.Node|undefined} */ 57 /** @type {?TimelineModel.TimelineProfileTree.Node|undefined} */
57 this._lastSelectedNode; 58 this._lastSelectedNode;
58 } 59 }
59 60
60 /** 61 /**
61 * @param {!Timeline.TimelineSelection} selection 62 * @param {!Timeline.TimelineSelection} selection
62 */ 63 */
63 updateContents(selection) { 64 updateContents(selection) {
64 this.setRange(selection.startTime(), selection.endTime()); 65 this.setRange(selection.startTime(), selection.endTime());
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 557 }
557 const groupBy = Timeline.AggregatedTimelineTreeView.GroupBy; 558 const groupBy = Timeline.AggregatedTimelineTreeView.GroupBy;
558 addGroupingOption.call(this, Common.UIString('No Grouping'), groupBy.None); 559 addGroupingOption.call(this, Common.UIString('No Grouping'), groupBy.None);
559 addGroupingOption.call(this, Common.UIString('Group by Activity'), groupBy.E ventName); 560 addGroupingOption.call(this, Common.UIString('Group by Activity'), groupBy.E ventName);
560 addGroupingOption.call(this, Common.UIString('Group by Category'), groupBy.C ategory); 561 addGroupingOption.call(this, Common.UIString('Group by Category'), groupBy.C ategory);
561 addGroupingOption.call(this, Common.UIString('Group by Domain'), groupBy.Dom ain); 562 addGroupingOption.call(this, Common.UIString('Group by Domain'), groupBy.Dom ain);
562 addGroupingOption.call(this, Common.UIString('Group by Subdomain'), groupBy. Subdomain); 563 addGroupingOption.call(this, Common.UIString('Group by Subdomain'), groupBy. Subdomain);
563 addGroupingOption.call(this, Common.UIString('Group by URL'), groupBy.URL); 564 addGroupingOption.call(this, Common.UIString('Group by URL'), groupBy.URL);
564 addGroupingOption.call(this, Common.UIString('Group by Frame'), groupBy.Fram e); 565 addGroupingOption.call(this, Common.UIString('Group by Frame'), groupBy.Fram e);
565 panelToolbar.appendToolbarItem(this._groupByCombobox); 566 panelToolbar.appendToolbarItem(this._groupByCombobox);
567 panelToolbar.appendSpacer();
568 panelToolbar.appendToolbarItem(this._splitWidget.createShowHideSidebarButton (Common.UIString('heaviest stack')));
566 } 569 }
567 570
568 /** 571 /**
569 * @param {!TimelineModel.TimelineProfileTree.Node} treeNode 572 * @param {!TimelineModel.TimelineProfileTree.Node} treeNode
570 * @return {!Array<!TimelineModel.TimelineProfileTree.Node>} 573 * @return {!Array<!TimelineModel.TimelineProfileTree.Node>}
571 */ 574 */
572 _buildHeaviestStack(treeNode) { 575 _buildHeaviestStack(treeNode) {
573 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root'); 576 console.assert(!!treeNode.parent, 'Attempt to build stack for tree root');
574 var result = []; 577 var result = [];
575 // Do not add root to the stack, as it's the tree itself. 578 // Do not add root to the stack, as it's the tree itself.
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 953
951 _onSelectionChanged() { 954 _onSelectionChanged() {
952 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged); 955 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged);
953 } 956 }
954 }; 957 };
955 958
956 /** @enum {symbol} */ 959 /** @enum {symbol} */
957 Timeline.TimelineStackView.Events = { 960 Timeline.TimelineStackView.Events = {
958 SelectionChanged: Symbol('SelectionChanged') 961 SelectionChanged: Symbol('SelectionChanged')
959 }; 962 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698