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

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

Issue 1636853002: Timeline: simplify handling of event category colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 /** 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 groupNode.id = id; 704 groupNode.id = id;
705 groupNode.selfTime = 0; 705 groupNode.selfTime = 0;
706 groupNode.totalTime = 0; 706 groupNode.totalTime = 0;
707 groupNode.children = new Map(); 707 groupNode.children = new Map();
708 this._groupNodes.set(id, groupNode); 708 this._groupNodes.set(id, groupNode);
709 var categories = WebInspector.TimelineUIUtils.categories(); 709 var categories = WebInspector.TimelineUIUtils.categories();
710 switch (this._groupBySetting.get()) { 710 switch (this._groupBySetting.get()) {
711 case WebInspector.AggregatedTimelineTreeView.GroupBy.Category: 711 case WebInspector.AggregatedTimelineTreeView.GroupBy.Category:
712 var category = categories[id] || categories["other"]; 712 var category = categories[id] || categories["other"];
713 groupNode.name = category.title; 713 groupNode.name = category.title;
714 groupNode.color = category.fillColorStop1; 714 groupNode.color = category.color;
715 break; 715 break;
716 case WebInspector.AggregatedTimelineTreeView.GroupBy.Domain: 716 case WebInspector.AggregatedTimelineTreeView.GroupBy.Domain:
717 case WebInspector.AggregatedTimelineTreeView.GroupBy.Subdomain: 717 case WebInspector.AggregatedTimelineTreeView.GroupBy.Subdomain:
718 case WebInspector.AggregatedTimelineTreeView.GroupBy.URL: 718 case WebInspector.AggregatedTimelineTreeView.GroupBy.URL:
719 groupNode.name = id || WebInspector.UIString("unattributed"); 719 groupNode.name = id || WebInspector.UIString("unattributed");
720 groupNode.color = id ? WebInspector.TimelineUIUtils.eventColor(event ) : categories["other"].fillColorStop1; 720 groupNode.color = id ? WebInspector.TimelineUIUtils.eventColor(event ) : categories["other"].color;
721 break; 721 break;
722 } 722 }
723 return groupNode; 723 return groupNode;
724 }, 724 },
725 725
726 /** 726 /**
727 * @return {?function(!WebInspector.TimelineTreeView.ProfileTreeNode):string } 727 * @return {?function(!WebInspector.TimelineTreeView.ProfileTreeNode):string }
728 */ 728 */
729 _nodeToGroupIdFunction: function() 729 _nodeToGroupIdFunction: function()
730 { 730 {
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; 1157 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode;
1158 }, 1158 },
1159 1159
1160 _onSelectionChanged: function() 1160 _onSelectionChanged: function()
1161 { 1161 {
1162 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); 1162 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged);
1163 }, 1163 },
1164 1164
1165 __proto__: WebInspector.VBox.prototype 1165 __proto__: WebInspector.VBox.prototype
1166 } 1166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698