| OLD | NEW |
| 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 /** | 5 /** |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 * @implements {UI.Searchable} | 7 * @implements {UI.Searchable} |
| 8 */ | 8 */ |
| 9 Timeline.TimelineTreeView = class extends UI.VBox { | 9 Timeline.TimelineTreeView = class extends UI.VBox { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 this._dataGrid.setRowContextMenuCallback(this._onContextMenu.bind(this)); | 77 this._dataGrid.setRowContextMenuCallback(this._onContextMenu.bind(this)); |
| 78 this._dataGrid.asWidget().show(mainView.element); | 78 this._dataGrid.asWidget().show(mainView.element); |
| 79 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SelectedNode, this.
_updateDetailsForSelection, this); | 79 this._dataGrid.addEventListener(DataGrid.DataGrid.Events.SelectedNode, this.
_updateDetailsForSelection, this); |
| 80 | 80 |
| 81 this._detailsView = new UI.VBox(); | 81 this._detailsView = new UI.VBox(); |
| 82 this._detailsView.element.classList.add('timeline-details-view', 'timeline-d
etails-view-body'); | 82 this._detailsView.element.classList.add('timeline-details-view', 'timeline-d
etails-view-body'); |
| 83 this._splitWidget.setMainWidget(mainView); | 83 this._splitWidget.setMainWidget(mainView); |
| 84 this._splitWidget.setSidebarWidget(this._detailsView); | 84 this._splitWidget.setSidebarWidget(this._detailsView); |
| 85 this._splitWidget.hideSidebar(); | 85 this._splitWidget.hideSidebar(); |
| 86 this._splitWidget.show(this.element); | 86 this._splitWidget.show(this.element); |
| 87 this._splitWidget.addEventListener(UI.SplitWidget.Events.ShowModeChanged, th
is._updateDetailsForSelection, this); |
| 87 | 88 |
| 88 /** @type {?TimelineModel.TimelineProfileTree.Node|undefined} */ | 89 /** @type {?TimelineModel.TimelineProfileTree.Node|undefined} */ |
| 89 this._lastSelectedNode; | 90 this._lastSelectedNode; |
| 90 } | 91 } |
| 91 | 92 |
| 92 /** | 93 /** |
| 93 * @protected | 94 * @protected |
| 94 * @return {?TimelineModel.TimelineProfileTree.Node|undefined} | 95 * @return {?TimelineModel.TimelineProfileTree.Node|undefined} |
| 95 */ | 96 */ |
| 96 lastSelectedNode() { | 97 lastSelectedNode() { |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 352 } |
| 352 } | 353 } |
| 353 | 354 |
| 354 _updateDetailsForSelection() { | 355 _updateDetailsForSelection() { |
| 355 var selectedNode = this._dataGrid.selectedNode ? | 356 var selectedNode = this._dataGrid.selectedNode ? |
| 356 /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (this._dataGrid.s
electedNode)._profileNode : | 357 /** @type {!Timeline.TimelineTreeView.TreeGridNode} */ (this._dataGrid.s
electedNode)._profileNode : |
| 357 null; | 358 null; |
| 358 if (selectedNode === this._lastSelectedNode) | 359 if (selectedNode === this._lastSelectedNode) |
| 359 return; | 360 return; |
| 360 this._lastSelectedNode = selectedNode; | 361 this._lastSelectedNode = selectedNode; |
| 362 if (this._splitWidget.showMode() === UI.SplitWidget.ShowMode.OnlyMain) |
| 363 return; |
| 361 this._detailsView.detachChildWidgets(); | 364 this._detailsView.detachChildWidgets(); |
| 362 this._detailsView.element.removeChildren(); | 365 this._detailsView.element.removeChildren(); |
| 363 if (!selectedNode || !this._showDetailsForNode(selectedNode)) { | 366 if (!selectedNode || !this._showDetailsForNode(selectedNode)) { |
| 364 var banner = this._detailsView.element.createChild('div', 'full-widget-dim
med-banner'); | 367 var banner = this._detailsView.element.createChild('div', 'full-widget-dim
med-banner'); |
| 365 banner.createTextChild(Common.UIString('Select item for details.')); | 368 banner.createTextChild(Common.UIString('Select item for details.')); |
| 366 } | 369 } |
| 367 } | 370 } |
| 368 | 371 |
| 369 /** | 372 /** |
| 370 * @param {!TimelineModel.TimelineProfileTree.Node} node | 373 * @param {!TimelineModel.TimelineProfileTree.Node} node |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 990 |
| 988 _onSelectionChanged() { | 991 _onSelectionChanged() { |
| 989 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha
nged); | 992 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha
nged); |
| 990 } | 993 } |
| 991 }; | 994 }; |
| 992 | 995 |
| 993 /** @enum {symbol} */ | 996 /** @enum {symbol} */ |
| 994 Timeline.TimelineStackView.Events = { | 997 Timeline.TimelineStackView.Events = { |
| 995 SelectionChanged: Symbol('SelectionChanged') | 998 SelectionChanged: Symbol('SelectionChanged') |
| 996 }; | 999 }; |
| OLD | NEW |