| 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @param {!WebInspector.TimelineModel} model | 8 * @param {!WebInspector.TimelineModel} model |
| 9 */ | 9 */ |
| 10 WebInspector.TimelineTreeView = function(model) | 10 WebInspector.TimelineTreeView = function(model) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 /** | 146 /** |
| 147 * @param {function(!WebInspector.TracingModel.Event):(string|symbol)=} even
tIdCallback | 147 * @param {function(!WebInspector.TracingModel.Event):(string|symbol)=} even
tIdCallback |
| 148 * @return {!WebInspector.TimelineProfileTree.Node} | 148 * @return {!WebInspector.TimelineProfileTree.Node} |
| 149 */ | 149 */ |
| 150 _buildTopDownTree: function(eventIdCallback) | 150 _buildTopDownTree: function(eventIdCallback) |
| 151 { | 151 { |
| 152 return WebInspector.TimelineProfileTree.buildTopDown(this._model.mainThr
eadEvents(), this._filters, this._startTime, this._endTime, eventIdCallback) | 152 return WebInspector.TimelineProfileTree.buildTopDown(this._model.mainThr
eadEvents(), this._filters, this._startTime, this._endTime, eventIdCallback) |
| 153 }, | 153 }, |
| 154 | 154 |
| 155 /** | 155 /** |
| 156 * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columns | 156 * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns |
| 157 */ | 157 */ |
| 158 _populateColumns: function(columns) | 158 _populateColumns: function(columns) |
| 159 { | 159 { |
| 160 columns.push({id: "self", title: WebInspector.UIString("Self Time"), wid
th: "110px", fixedWidth: true, sortable: true}); | 160 var columnDescriptors = [ |
| 161 columns.push({id: "total", title: WebInspector.UIString("Total Time"), w
idth: "110px", fixedWidth: true, sortable: true}); | 161 {id: "self", title: WebInspector.UIString("Self Time"), width: "110p
x", fixedWidth: true, sortable: true}, |
| 162 columns.push({id: "activity", title: WebInspector.UIString("Activity"),
disclosure: true, sortable: true}); | 162 {id: "total", title: WebInspector.UIString("Total Time"), width: "11
0px", fixedWidth: true, sortable: true}, |
| 163 {id: "activity", title: WebInspector.UIString("Activity"), disclosur
e: true, sortable: true}]; |
| 164 for (var descriptor of columnDescriptors) |
| 165 columns.push(/** @type {!WebInspector.DataGrid.ColumnDescriptor} */(
descriptor)); |
| 163 }, | 166 }, |
| 164 | 167 |
| 165 _sortingChanged: function() | 168 _sortingChanged: function() |
| 166 { | 169 { |
| 167 var columnIdentifier = this._dataGrid.sortColumnIdentifier(); | 170 var columnIdentifier = this._dataGrid.sortColumnIdentifier(); |
| 168 if (!columnIdentifier) | 171 if (!columnIdentifier) |
| 169 return; | 172 return; |
| 170 var sortFunction; | 173 var sortFunction; |
| 171 switch (columnIdentifier) { | 174 switch (columnIdentifier) { |
| 172 case "startTime": | 175 case "startTime": |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 if (expand) | 894 if (expand) |
| 892 this._dataGridNodeForTreeNode(node).expand(); | 895 this._dataGridNodeForTreeNode(node).expand(); |
| 893 }, | 896 }, |
| 894 | 897 |
| 895 /** | 898 /** |
| 896 * @override | 899 * @override |
| 897 * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns | 900 * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns |
| 898 */ | 901 */ |
| 899 _populateColumns: function(columns) | 902 _populateColumns: function(columns) |
| 900 { | 903 { |
| 901 columns.push({id: "startTime", title: WebInspector.UIString("Start Time"
), width: "110px", fixedWidth: true, sortable: true}); | 904 var descriptors = [{id: "startTime", title: WebInspector.UIString("Start
Time"), width: "110px", fixedWidth: true, sortable: true}]; |
| 905 columns.push(/** @type {!WebInspector.DataGrid.ColumnDescriptor} */(desc
riptors[0])); |
| 902 WebInspector.TimelineTreeView.prototype._populateColumns.call(this, colu
mns); | 906 WebInspector.TimelineTreeView.prototype._populateColumns.call(this, colu
mns); |
| 903 }, | 907 }, |
| 904 | 908 |
| 905 /** | 909 /** |
| 906 * @override | 910 * @override |
| 907 * @param {!Element} parent | 911 * @param {!Element} parent |
| 908 */ | 912 */ |
| 909 _populateToolbar: function(parent) | 913 _populateToolbar: function(parent) |
| 910 { | 914 { |
| 911 var filtersWidget = this._filtersControl.filtersWidget(); | 915 var filtersWidget = this._filtersControl.filtersWidget(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod
e} */ (selectedNode)._profileNode; | 1008 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod
e} */ (selectedNode)._profileNode; |
| 1005 }, | 1009 }, |
| 1006 | 1010 |
| 1007 _onSelectionChanged: function() | 1011 _onSelectionChanged: function() |
| 1008 { | 1012 { |
| 1009 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele
ctionChanged); | 1013 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele
ctionChanged); |
| 1010 }, | 1014 }, |
| 1011 | 1015 |
| 1012 __proto__: WebInspector.VBox.prototype | 1016 __proto__: WebInspector.VBox.prototype |
| 1013 } | 1017 } |
| OLD | NEW |