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

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

Issue 2440953003: DevTools: use semicolons after each statement. (Closed)
Patch Set: rebaseline Created 4 years, 1 month 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @param {!WebInspector.TimelineModel} model 8 * @param {!WebInspector.TimelineModel} model
9 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters 9 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
10 */ 10 */
11 WebInspector.TimelineTreeView = function(model, filters) 11 WebInspector.TimelineTreeView = function(model, filters)
12 { 12 {
13 WebInspector.VBox.call(this); 13 WebInspector.VBox.call(this);
14 this.element.classList.add("timeline-tree-view"); 14 this.element.classList.add("timeline-tree-view");
15 15
16 this._model = model; 16 this._model = model;
17 this._linkifier = new WebInspector.Linkifier(); 17 this._linkifier = new WebInspector.Linkifier();
18 18
19 this._filters = filters.slice(); 19 this._filters = filters.slice();
20 20
21 var columns = []; 21 var columns = [];
22 this._populateColumns(columns); 22 this._populateColumns(columns);
23 23
24 var mainView = new WebInspector.VBox(); 24 var mainView = new WebInspector.VBox();
25 this._populateToolbar(mainView.element); 25 this._populateToolbar(mainView.element);
26 this._dataGrid = new WebInspector.SortableDataGrid(columns); 26 this._dataGrid = new WebInspector.SortableDataGrid(columns);
27 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortingChanged, this); 27 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortingChanged, this);
28 this._dataGrid.element.addEventListener("mousemove", this._onMouseMove.bind( this), true) 28 this._dataGrid.element.addEventListener("mousemove", this._onMouseMove.bind( this), true);
29 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); 29 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last);
30 this._dataGrid.asWidget().show(mainView.element); 30 this._dataGrid.asWidget().show(mainView.element);
31 31
32 this._splitWidget = new WebInspector.SplitWidget(true, true, "timelineTreeVi ewDetailsSplitWidget"); 32 this._splitWidget = new WebInspector.SplitWidget(true, true, "timelineTreeVi ewDetailsSplitWidget");
33 this._splitWidget.show(this.element); 33 this._splitWidget.show(this.element);
34 this._splitWidget.setMainWidget(mainView); 34 this._splitWidget.setMainWidget(mainView);
35 35
36 this._detailsView = new WebInspector.VBox(); 36 this._detailsView = new WebInspector.VBox();
37 this._detailsView.element.classList.add("timeline-details-view", "timeline-d etails-view-body"); 37 this._detailsView.element.classList.add("timeline-details-view", "timeline-d etails-view-body");
38 this._splitWidget.setSidebarWidget(this._detailsView); 38 this._splitWidget.setSidebarWidget(this._detailsView);
39 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, t his._updateDetailsForSelection, this); 39 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, t his._updateDetailsForSelection, this);
40 40
41 /** @type {?WebInspector.TimelineProfileTree.Node|undefined} */ 41 /** @type {?WebInspector.TimelineProfileTree.Node|undefined} */
42 this._lastSelectedNode; 42 this._lastSelectedNode;
43 } 43 };
44 44
45 WebInspector.TimelineTreeView.prototype = { 45 WebInspector.TimelineTreeView.prototype = {
46 /** 46 /**
47 * @param {!WebInspector.TimelineSelection} selection 47 * @param {!WebInspector.TimelineSelection} selection
48 */ 48 */
49 updateContents: function(selection) 49 updateContents: function(selection)
50 { 50 {
51 this.setRange(selection.startTime(), selection.endTime()); 51 this.setRange(selection.startTime(), selection.endTime());
52 }, 52 },
53 53
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 { 145 {
146 throw new Error("Not Implemented"); 146 throw new Error("Not Implemented");
147 }, 147 },
148 148
149 /** 149 /**
150 * @param {function(!WebInspector.TracingModel.Event):(string|symbol)=} even tIdCallback 150 * @param {function(!WebInspector.TracingModel.Event):(string|symbol)=} even tIdCallback
151 * @return {!WebInspector.TimelineProfileTree.Node} 151 * @return {!WebInspector.TimelineProfileTree.Node}
152 */ 152 */
153 _buildTopDownTree: function(eventIdCallback) 153 _buildTopDownTree: function(eventIdCallback)
154 { 154 {
155 return WebInspector.TimelineProfileTree.buildTopDown(this._model.mainThr eadEvents(), this._filters, this._startTime, this._endTime, eventIdCallback) 155 return WebInspector.TimelineProfileTree.buildTopDown(this._model.mainThr eadEvents(), this._filters, this._startTime, this._endTime, eventIdCallback);
156 }, 156 },
157 157
158 /** 158 /**
159 * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns 159 * @param {!Array<!WebInspector.DataGrid.ColumnDescriptor>} columns
160 */ 160 */
161 _populateColumns: function(columns) 161 _populateColumns: function(columns)
162 { 162 {
163 columns.push({id: "self", title: WebInspector.UIString("Self Time"), wid th: "110px", fixedWidth: true, sortable: true}); 163 columns.push({id: "self", title: WebInspector.UIString("Self Time"), wid th: "110px", fixedWidth: true, sortable: true});
164 columns.push({id: "total", title: WebInspector.UIString("Total Time"), w idth: "110px", fixedWidth: true, sortable: true}); 164 columns.push({id: "total", title: WebInspector.UIString("Total Time"), w idth: "110px", fixedWidth: true, sortable: true});
165 columns.push({id: "activity", title: WebInspector.UIString("Activity"), disclosure: true, sortable: true}); 165 columns.push({id: "activity", title: WebInspector.UIString("Activity"), disclosure: true, sortable: true});
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 /** 271 /**
272 * @param {!WebInspector.TimelineProfileTree.Node} treeNode 272 * @param {!WebInspector.TimelineProfileTree.Node} treeNode
273 * @return {?WebInspector.TimelineTreeView.GridNode} 273 * @return {?WebInspector.TimelineTreeView.GridNode}
274 */ 274 */
275 _dataGridNodeForTreeNode: function(treeNode) 275 _dataGridNodeForTreeNode: function(treeNode)
276 { 276 {
277 return treeNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymb ol] || null; 277 return treeNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymb ol] || null;
278 }, 278 },
279 279
280 __proto__: WebInspector.VBox.prototype 280 __proto__: WebInspector.VBox.prototype
281 } 281 };
282 282
283 /** 283 /**
284 * @param {!WebInspector.TracingModel.Event} event 284 * @param {!WebInspector.TracingModel.Event} event
285 * @return {string} 285 * @return {string}
286 */ 286 */
287 WebInspector.TimelineTreeView.eventNameForSorting = function(event) 287 WebInspector.TimelineTreeView.eventNameForSorting = function(event)
288 { 288 {
289 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { 289 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) {
290 var data = event.args["data"]; 290 var data = event.args["data"];
291 return data["functionName"] + "@" + (data["scriptId"] || data["url"] || ""); 291 return data["functionName"] + "@" + (data["scriptId"] || data["url"] || "");
292 } 292 }
293 return event.name + ":@" + WebInspector.TimelineProfileTree.eventURL(event); 293 return event.name + ":@" + WebInspector.TimelineProfileTree.eventURL(event);
294 } 294 };
295 295
296 /** 296 /**
297 * @constructor 297 * @constructor
298 * @extends {WebInspector.SortableDataGridNode} 298 * @extends {WebInspector.SortableDataGridNode}
299 * @param {!WebInspector.TimelineProfileTree.Node} profileNode 299 * @param {!WebInspector.TimelineProfileTree.Node} profileNode
300 * @param {number} grandTotalTime 300 * @param {number} grandTotalTime
301 * @param {number} maxSelfTime 301 * @param {number} maxSelfTime
302 * @param {number} maxTotalTime 302 * @param {number} maxTotalTime
303 * @param {!WebInspector.TimelineTreeView} treeView 303 * @param {!WebInspector.TimelineTreeView} treeView
304 */ 304 */
305 WebInspector.TimelineTreeView.GridNode = function(profileNode, grandTotalTime, m axSelfTime, maxTotalTime, treeView) 305 WebInspector.TimelineTreeView.GridNode = function(profileNode, grandTotalTime, m axSelfTime, maxTotalTime, treeView)
306 { 306 {
307 this._populated = false; 307 this._populated = false;
308 this._profileNode = profileNode; 308 this._profileNode = profileNode;
309 this._treeView = treeView; 309 this._treeView = treeView;
310 this._grandTotalTime = grandTotalTime; 310 this._grandTotalTime = grandTotalTime;
311 this._maxSelfTime = maxSelfTime; 311 this._maxSelfTime = maxSelfTime;
312 this._maxTotalTime = maxTotalTime; 312 this._maxTotalTime = maxTotalTime;
313 WebInspector.SortableDataGridNode.call(this, null, false); 313 WebInspector.SortableDataGridNode.call(this, null, false);
314 } 314 };
315 315
316 WebInspector.TimelineTreeView.GridNode.prototype = { 316 WebInspector.TimelineTreeView.GridNode.prototype = {
317 /** 317 /**
318 * @override 318 * @override
319 * @param {string} columnIdentifier 319 * @param {string} columnIdentifier
320 * @return {!Element} 320 * @return {!Element}
321 */ 321 */
322 createCell: function(columnIdentifier) 322 createCell: function(columnIdentifier)
323 { 323 {
324 if (columnIdentifier === "activity") 324 if (columnIdentifier === "activity")
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (showPercents && this._treeView._exposePercentages()) 395 if (showPercents && this._treeView._exposePercentages())
396 textDiv.createChild("span", "percent-column").textContent = WebInspe ctor.UIString("%.1f\u2009%%", value / this._grandTotalTime * 100); 396 textDiv.createChild("span", "percent-column").textContent = WebInspe ctor.UIString("%.1f\u2009%%", value / this._grandTotalTime * 100);
397 if (maxTime) { 397 if (maxTime) {
398 textDiv.classList.add("background-percent-bar"); 398 textDiv.classList.add("background-percent-bar");
399 cell.createChild("div", "background-bar-container").createChild("div ", "background-bar").style.width = (value * 100 / maxTime).toFixed(1) + "%"; 399 cell.createChild("div", "background-bar-container").createChild("div ", "background-bar").style.width = (value * 100 / maxTime).toFixed(1) + "%";
400 } 400 }
401 return cell; 401 return cell;
402 }, 402 },
403 403
404 __proto__: WebInspector.SortableDataGridNode.prototype 404 __proto__: WebInspector.SortableDataGridNode.prototype
405 } 405 };
406 406
407 /** 407 /**
408 * @constructor 408 * @constructor
409 * @extends {WebInspector.TimelineTreeView.GridNode} 409 * @extends {WebInspector.TimelineTreeView.GridNode}
410 * @param {!WebInspector.TimelineProfileTree.Node} profileNode 410 * @param {!WebInspector.TimelineProfileTree.Node} profileNode
411 * @param {number} grandTotalTime 411 * @param {number} grandTotalTime
412 * @param {number} maxSelfTime 412 * @param {number} maxSelfTime
413 * @param {number} maxTotalTime 413 * @param {number} maxTotalTime
414 * @param {!WebInspector.TimelineTreeView} treeView 414 * @param {!WebInspector.TimelineTreeView} treeView
415 */ 415 */
416 WebInspector.TimelineTreeView.TreeGridNode = function(profileNode, grandTotalTim e, maxSelfTime, maxTotalTime, treeView) 416 WebInspector.TimelineTreeView.TreeGridNode = function(profileNode, grandTotalTim e, maxSelfTime, maxTotalTime, treeView)
417 { 417 {
418 WebInspector.TimelineTreeView.GridNode.call(this, profileNode, grandTotalTim e, maxSelfTime, maxTotalTime, treeView); 418 WebInspector.TimelineTreeView.GridNode.call(this, profileNode, grandTotalTim e, maxSelfTime, maxTotalTime, treeView);
419 this.hasChildren = this._profileNode.children ? this._profileNode.children.s ize > 0 : false; 419 this.hasChildren = this._profileNode.children ? this._profileNode.children.s ize > 0 : false;
420 profileNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol] = th is; 420 profileNode[WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol] = th is;
421 } 421 };
422 422
423 WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol = Symbol("treeGridNod e"); 423 WebInspector.TimelineTreeView.TreeGridNode._gridNodeSymbol = Symbol("treeGridNod e");
424 424
425 WebInspector.TimelineTreeView.TreeGridNode.prototype = { 425 WebInspector.TimelineTreeView.TreeGridNode.prototype = {
426 /** 426 /**
427 * @override 427 * @override
428 */ 428 */
429 populate: function() 429 populate: function()
430 { 430 {
431 if (this._populated) 431 if (this._populated)
(...skipping 22 matching lines...) Expand all
454 this._groupBySetting = WebInspector.settings.createSetting("timelineTreeGrou pBy", WebInspector.TimelineAggregator.GroupBy.Category); 454 this._groupBySetting = WebInspector.settings.createSetting("timelineTreeGrou pBy", WebInspector.TimelineAggregator.GroupBy.Category);
455 WebInspector.TimelineTreeView.call(this, model, filters); 455 WebInspector.TimelineTreeView.call(this, model, filters);
456 var nonessentialEvents = [ 456 var nonessentialEvents = [
457 WebInspector.TimelineModel.RecordType.EventDispatch, 457 WebInspector.TimelineModel.RecordType.EventDispatch,
458 WebInspector.TimelineModel.RecordType.FunctionCall, 458 WebInspector.TimelineModel.RecordType.FunctionCall,
459 WebInspector.TimelineModel.RecordType.TimerFire 459 WebInspector.TimelineModel.RecordType.TimerFire
460 ]; 460 ];
461 this._filters.push(new WebInspector.ExclusiveNameFilter(nonessentialEvents)) ; 461 this._filters.push(new WebInspector.ExclusiveNameFilter(nonessentialEvents)) ;
462 this._stackView = new WebInspector.TimelineStackView(this); 462 this._stackView = new WebInspector.TimelineStackView(this);
463 this._stackView.addEventListener(WebInspector.TimelineStackView.Events.Selec tionChanged, this._onStackViewSelectionChanged, this); 463 this._stackView.addEventListener(WebInspector.TimelineStackView.Events.Selec tionChanged, this._onStackViewSelectionChanged, this);
464 } 464 };
465 465
466 WebInspector.AggregatedTimelineTreeView.prototype = { 466 WebInspector.AggregatedTimelineTreeView.prototype = {
467 /** 467 /**
468 * @override 468 * @override
469 * @param {!WebInspector.TimelineSelection} selection 469 * @param {!WebInspector.TimelineSelection} selection
470 */ 470 */
471 updateContents: function(selection) 471 updateContents: function(selection)
472 { 472 {
473 this._updateExtensionResolver(); 473 this._updateExtensionResolver();
474 WebInspector.TimelineTreeView.prototype.updateContents.call(this, select ion); 474 WebInspector.TimelineTreeView.prototype.updateContents.call(this, select ion);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 /** 634 /**
635 * @constructor 635 * @constructor
636 * @extends {WebInspector.AggregatedTimelineTreeView} 636 * @extends {WebInspector.AggregatedTimelineTreeView}
637 * @param {!WebInspector.TimelineModel} model 637 * @param {!WebInspector.TimelineModel} model
638 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters 638 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
639 */ 639 */
640 WebInspector.CallTreeTimelineTreeView = function(model, filters) 640 WebInspector.CallTreeTimelineTreeView = function(model, filters)
641 { 641 {
642 WebInspector.AggregatedTimelineTreeView.call(this, model, filters); 642 WebInspector.AggregatedTimelineTreeView.call(this, model, filters);
643 this._dataGrid.markColumnAsSortedBy("total", WebInspector.DataGrid.Order.Des cending); 643 this._dataGrid.markColumnAsSortedBy("total", WebInspector.DataGrid.Order.Des cending);
644 } 644 };
645 645
646 WebInspector.CallTreeTimelineTreeView.prototype = { 646 WebInspector.CallTreeTimelineTreeView.prototype = {
647 /** 647 /**
648 * @override 648 * @override
649 * @return {!WebInspector.TimelineProfileTree.Node} 649 * @return {!WebInspector.TimelineProfileTree.Node}
650 */ 650 */
651 _buildTree: function() 651 _buildTree: function()
652 { 652 {
653 var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eve ntId); 653 var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eve ntId);
654 return this._createAggregator().performGrouping(topDown, this._groupBySe tting.get()); 654 return this._createAggregator().performGrouping(topDown, this._groupBySe tting.get());
655 }, 655 },
656 656
657 __proto__: WebInspector.AggregatedTimelineTreeView.prototype, 657 __proto__: WebInspector.AggregatedTimelineTreeView.prototype,
658 }; 658 };
659 659
660 /** 660 /**
661 * @constructor 661 * @constructor
662 * @extends {WebInspector.AggregatedTimelineTreeView} 662 * @extends {WebInspector.AggregatedTimelineTreeView}
663 * @param {!WebInspector.TimelineModel} model 663 * @param {!WebInspector.TimelineModel} model
664 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters 664 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
665 */ 665 */
666 WebInspector.BottomUpTimelineTreeView = function(model, filters) 666 WebInspector.BottomUpTimelineTreeView = function(model, filters)
667 { 667 {
668 WebInspector.AggregatedTimelineTreeView.call(this, model, filters); 668 WebInspector.AggregatedTimelineTreeView.call(this, model, filters);
669 this._dataGrid.markColumnAsSortedBy("self", WebInspector.DataGrid.Order.Desc ending); 669 this._dataGrid.markColumnAsSortedBy("self", WebInspector.DataGrid.Order.Desc ending);
670 } 670 };
671 671
672 WebInspector.BottomUpTimelineTreeView.prototype = { 672 WebInspector.BottomUpTimelineTreeView.prototype = {
673 /** 673 /**
674 * @override 674 * @override
675 * @return {!WebInspector.TimelineProfileTree.Node} 675 * @return {!WebInspector.TimelineProfileTree.Node}
676 */ 676 */
677 _buildTree: function() 677 _buildTree: function()
678 { 678 {
679 var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eve ntId); 679 var topDown = this._buildTopDownTree(WebInspector.TimelineAggregator.eve ntId);
680 return WebInspector.TimelineProfileTree.buildBottomUp(topDown, this._cre ateAggregator().groupFunction(this._groupBySetting.get())); 680 return WebInspector.TimelineProfileTree.buildBottomUp(topDown, this._cre ateAggregator().groupFunction(this._groupBySetting.get()));
(...skipping 10 matching lines...) Expand all
691 * @param {!WebInspector.TimelineModeViewDelegate} delegate 691 * @param {!WebInspector.TimelineModeViewDelegate} delegate
692 */ 692 */
693 WebInspector.EventsTimelineTreeView = function(model, filters, delegate) 693 WebInspector.EventsTimelineTreeView = function(model, filters, delegate)
694 { 694 {
695 this._filtersControl = new WebInspector.TimelineFilters(); 695 this._filtersControl = new WebInspector.TimelineFilters();
696 this._filtersControl.addEventListener(WebInspector.TimelineFilters.Events.Fi lterChanged, this._onFilterChanged, this); 696 this._filtersControl.addEventListener(WebInspector.TimelineFilters.Events.Fi lterChanged, this._onFilterChanged, this);
697 WebInspector.TimelineTreeView.call(this, model, filters); 697 WebInspector.TimelineTreeView.call(this, model, filters);
698 this._delegate = delegate; 698 this._delegate = delegate;
699 this._filters.push.apply(this._filters, this._filtersControl.filters()); 699 this._filters.push.apply(this._filters, this._filtersControl.filters());
700 this._dataGrid.markColumnAsSortedBy("startTime", WebInspector.DataGrid.Order .Ascending); 700 this._dataGrid.markColumnAsSortedBy("startTime", WebInspector.DataGrid.Order .Ascending);
701 } 701 };
702 702
703 WebInspector.EventsTimelineTreeView.prototype = { 703 WebInspector.EventsTimelineTreeView.prototype = {
704 /** 704 /**
705 * @override 705 * @override
706 * @param {!WebInspector.TimelineSelection} selection 706 * @param {!WebInspector.TimelineSelection} selection
707 */ 707 */
708 updateContents: function(selection) 708 updateContents: function(selection)
709 { 709 {
710 WebInspector.TimelineTreeView.prototype.updateContents.call(this, select ion); 710 WebInspector.TimelineTreeView.prototype.updateContents.call(this, select ion);
711 if (selection.type() === WebInspector.TimelineSelection.Type.TraceEvent) { 711 if (selection.type() === WebInspector.TimelineSelection.Type.TraceEvent) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 /** 816 /**
817 * @override 817 * @override
818 * @param {?WebInspector.TimelineProfileTree.Node} node 818 * @param {?WebInspector.TimelineProfileTree.Node} node
819 */ 819 */
820 _onHover: function(node) 820 _onHover: function(node)
821 { 821 {
822 this._delegate.highlightEvent(node && node.event); 822 this._delegate.highlightEvent(node && node.event);
823 }, 823 },
824 824
825 __proto__: WebInspector.TimelineTreeView.prototype 825 __proto__: WebInspector.TimelineTreeView.prototype
826 } 826 };
827 827
828 /** 828 /**
829 * @constructor 829 * @constructor
830 * @extends {WebInspector.VBox} 830 * @extends {WebInspector.VBox}
831 */ 831 */
832 WebInspector.TimelineStackView = function(treeView) 832 WebInspector.TimelineStackView = function(treeView)
833 { 833 {
834 WebInspector.VBox.call(this); 834 WebInspector.VBox.call(this);
835 var header = this.element.createChild("div", "timeline-stack-view-header"); 835 var header = this.element.createChild("div", "timeline-stack-view-header");
836 header.textContent = WebInspector.UIString("Heaviest stack"); 836 header.textContent = WebInspector.UIString("Heaviest stack");
837 this._treeView = treeView; 837 this._treeView = treeView;
838 var columns = [ 838 var columns = [
839 {id: "total", title: WebInspector.UIString("Total Time"), fixedWidth: tr ue, width: "110px"}, 839 {id: "total", title: WebInspector.UIString("Total Time"), fixedWidth: tr ue, width: "110px"},
840 {id: "activity", title: WebInspector.UIString("Activity")} 840 {id: "activity", title: WebInspector.UIString("Activity")}
841 ]; 841 ];
842 this._dataGrid = new WebInspector.ViewportDataGrid(columns); 842 this._dataGrid = new WebInspector.ViewportDataGrid(columns);
843 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); 843 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last);
844 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, t his._onSelectionChanged, this); 844 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, t his._onSelectionChanged, this);
845 this._dataGrid.asWidget().show(this.element); 845 this._dataGrid.asWidget().show(this.element);
846 } 846 };
847 847
848 /** @enum {symbol} */ 848 /** @enum {symbol} */
849 WebInspector.TimelineStackView.Events = { 849 WebInspector.TimelineStackView.Events = {
850 SelectionChanged: Symbol("SelectionChanged") 850 SelectionChanged: Symbol("SelectionChanged")
851 } 851 };
852 852
853 WebInspector.TimelineStackView.prototype = { 853 WebInspector.TimelineStackView.prototype = {
854 /** 854 /**
855 * @param {!Array<!WebInspector.TimelineProfileTree.Node>} stack 855 * @param {!Array<!WebInspector.TimelineProfileTree.Node>} stack
856 * @param {!WebInspector.TimelineProfileTree.Node} selectedNode 856 * @param {!WebInspector.TimelineProfileTree.Node} selectedNode
857 */ 857 */
858 setStack: function(stack, selectedNode) 858 setStack: function(stack, selectedNode)
859 { 859 {
860 var rootNode = this._dataGrid.rootNode(); 860 var rootNode = this._dataGrid.rootNode();
861 rootNode.removeChildren(); 861 rootNode.removeChildren();
(...skipping 16 matching lines...) Expand all
878 var selectedNode = this._dataGrid.selectedNode; 878 var selectedNode = this._dataGrid.selectedNode;
879 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; 879 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode;
880 }, 880 },
881 881
882 _onSelectionChanged: function() 882 _onSelectionChanged: function()
883 { 883 {
884 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); 884 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged);
885 }, 885 },
886 886
887 __proto__: WebInspector.VBox.prototype 887 __proto__: WebInspector.VBox.prototype
888 } 888 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698