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

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

Issue 2010943002: DevTools: Add grouping by Activity to Timeline treeview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters 9 * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
10 */ 10 */
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 482 }
483 }, 483 },
484 484
485 /** 485 /**
486 * @param {!WebInspector.TimelineProfileTree.Node} node 486 * @param {!WebInspector.TimelineProfileTree.Node} node
487 * @return {!{name: string, color: string}} 487 * @return {!{name: string, color: string}}
488 */ 488 */
489 _displayInfoForGroupNode: function(node) 489 _displayInfoForGroupNode: function(node)
490 { 490 {
491 var categories = WebInspector.TimelineUIUtils.categories(); 491 var categories = WebInspector.TimelineUIUtils.categories();
492 var color = node.id ? WebInspector.TimelineUIUtils.eventColor(node.event ) : categories["other"].color;
493
492 switch (this._groupBySetting.get()) { 494 switch (this._groupBySetting.get()) {
493 case WebInspector.TimelineAggregator.GroupBy.Category: 495 case WebInspector.TimelineAggregator.GroupBy.Category:
494 var category = categories[node.id] || categories["other"]; 496 var category = categories[node.id] || categories["other"];
495 return {name: category.title, color: category.color}; 497 return {name: category.title, color: category.color};
496 498
497 case WebInspector.TimelineAggregator.GroupBy.Domain: 499 case WebInspector.TimelineAggregator.GroupBy.Domain:
498 case WebInspector.TimelineAggregator.GroupBy.Subdomain: 500 case WebInspector.TimelineAggregator.GroupBy.Subdomain:
499 var name = node.id; 501 var name = node.id;
500 if (WebInspector.TimelineAggregator.isExtensionInternalURL(name)) 502 if (WebInspector.TimelineAggregator.isExtensionInternalURL(name))
501 name = WebInspector.UIString("[Chrome extensions overhead]"); 503 name = WebInspector.UIString("[Chrome extensions overhead]");
502 else if (name.startsWith("chrome-extension")) 504 else if (name.startsWith("chrome-extension"))
503 name = this._executionContextNamesByOrigin.get(name) || name; 505 name = this._executionContextNamesByOrigin.get(name) || name;
504 return { 506 return {
505 name: name || WebInspector.UIString("unattributed"), 507 name: name || WebInspector.UIString("unattributed"),
506 color: node.id ? WebInspector.TimelineUIUtils.eventColor(node.ev ent) : categories["other"].color 508 color: color
509 }
alph 2016/05/26 07:23:20 missing ;
510
511 case WebInspector.TimelineAggregator.GroupBy.EventName:
512 var name = node.event.name === WebInspector.TimelineModel.RecordType .JSFrame ?
513 WebInspector.UIString("Execute Script") : WebInspector.TimelineU IUtils.eventTitle(node.event);
alph 2016/05/26 07:23:21 Strange name. Maybe "JavaScript"?
514 return {
515 name: name,
516 color: node.event.name === WebInspector.TimelineModel.RecordType .JSFrame ?
517 WebInspector.TimelineUIUtils.eventStyle(node.event).category .color : color
507 } 518 }
alph 2016/05/26 07:23:21 missing ;
508 519
509 case WebInspector.TimelineAggregator.GroupBy.URL: 520 case WebInspector.TimelineAggregator.GroupBy.URL:
510 break; 521 break;
511 522
512 default: 523 default:
513 console.assert(false, "Unexpected aggregation type"); 524 console.assert(false, "Unexpected aggregation type");
514 } 525 }
515 return { 526 return {
516 name: node.id || WebInspector.UIString("unattributed"), 527 name: node.id || WebInspector.UIString("unattributed"),
517 color: node.id ? WebInspector.TimelineUIUtils.eventColor(node.event) : categories["other"].color 528 color: color
518 } 529 }
alph 2016/05/26 07:23:21 ditto
519 }, 530 },
520 531
521 /** 532 /**
522 * @override 533 * @override
523 * @param {!Element} parent 534 * @param {!Element} parent
524 */ 535 */
525 _populateToolbar: function(parent) 536 _populateToolbar: function(parent)
526 { 537 {
527 var panelToolbar = new WebInspector.Toolbar("", parent); 538 var panelToolbar = new WebInspector.Toolbar("", parent);
528 this._groupByCombobox = new WebInspector.ToolbarComboBox(this._onGroupBy Changed.bind(this)); 539 this._groupByCombobox = new WebInspector.ToolbarComboBox(this._onGroupBy Changed.bind(this));
529 /** 540 /**
530 * @param {string} name 541 * @param {string} name
531 * @param {string} id 542 * @param {string} id
532 * @this {WebInspector.TimelineTreeView} 543 * @this {WebInspector.TimelineTreeView}
533 */ 544 */
534 function addGroupingOption(name, id) 545 function addGroupingOption(name, id)
535 { 546 {
536 var option = this._groupByCombobox.createOption(name, "", id); 547 var option = this._groupByCombobox.createOption(name, "", id);
537 this._groupByCombobox.addOption(option); 548 this._groupByCombobox.addOption(option);
538 if (id === this._groupBySetting.get()) 549 if (id === this._groupBySetting.get())
539 this._groupByCombobox.select(option); 550 this._groupByCombobox.select(option);
540 } 551 }
541 addGroupingOption.call(this, WebInspector.UIString("No Grouping"), WebIn spector.TimelineAggregator.GroupBy.None); 552 addGroupingOption.call(this, WebInspector.UIString("No Grouping"), WebIn spector.TimelineAggregator.GroupBy.None);
553 addGroupingOption.call(this, WebInspector.UIString("Group by Activity"), WebInspector.TimelineAggregator.GroupBy.EventName);
542 addGroupingOption.call(this, WebInspector.UIString("Group by Category"), WebInspector.TimelineAggregator.GroupBy.Category); 554 addGroupingOption.call(this, WebInspector.UIString("Group by Category"), WebInspector.TimelineAggregator.GroupBy.Category);
543 addGroupingOption.call(this, WebInspector.UIString("Group by Domain"), W ebInspector.TimelineAggregator.GroupBy.Domain); 555 addGroupingOption.call(this, WebInspector.UIString("Group by Domain"), W ebInspector.TimelineAggregator.GroupBy.Domain);
544 addGroupingOption.call(this, WebInspector.UIString("Group by Subdomain") , WebInspector.TimelineAggregator.GroupBy.Subdomain); 556 addGroupingOption.call(this, WebInspector.UIString("Group by Subdomain") , WebInspector.TimelineAggregator.GroupBy.Subdomain);
545 addGroupingOption.call(this, WebInspector.UIString("Group by URL"), WebI nspector.TimelineAggregator.GroupBy.URL); 557 addGroupingOption.call(this, WebInspector.UIString("Group by URL"), WebI nspector.TimelineAggregator.GroupBy.URL);
546 panelToolbar.appendToolbarItem(this._groupByCombobox); 558 panelToolbar.appendToolbarItem(this._groupByCombobox);
547 }, 559 },
548 560
549 /** 561 /**
550 * @param {!WebInspector.TimelineProfileTree.Node} treeNode 562 * @param {!WebInspector.TimelineProfileTree.Node} treeNode
551 * @return {!Array<!WebInspector.TimelineProfileTree.Node>} 563 * @return {!Array<!WebInspector.TimelineProfileTree.Node>}
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode; 868 return selectedNode && /** @type {!WebInspector.TimelineTreeView.GridNod e} */ (selectedNode)._profileNode;
857 }, 869 },
858 870
859 _onSelectionChanged: function() 871 _onSelectionChanged: function()
860 { 872 {
861 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged); 873 this.dispatchEventToListeners(WebInspector.TimelineStackView.Events.Sele ctionChanged);
862 }, 874 },
863 875
864 __proto__: WebInspector.VBox.prototype 876 __proto__: WebInspector.VBox.prototype
865 } 877 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698