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

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

Issue 2838053003: DevTools: update group-by combobox upon tree view change in timeline aggregated details. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * @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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 * @unrestricted 624 * @unrestricted
625 */ 625 */
626 Timeline.AggregatedTimelineTreeView = class extends Timeline.TimelineTreeView { 626 Timeline.AggregatedTimelineTreeView = class extends Timeline.TimelineTreeView {
627 /** 627 /**
628 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters 628 * @param {!Array<!TimelineModel.TimelineModelFilter>} filters
629 */ 629 */
630 constructor(filters) { 630 constructor(filters) {
631 super(); 631 super();
632 this._groupBySetting = 632 this._groupBySetting =
633 Common.settings.createSetting('timelineTreeGroupBy', Timeline.Aggregated TimelineTreeView.GroupBy.None); 633 Common.settings.createSetting('timelineTreeGroupBy', Timeline.Aggregated TimelineTreeView.GroupBy.None);
634 this._groupByCombobox = new UI.ToolbarComboBox(this._onGroupByChanged.bind(t his));
634 this.init(filters); 635 this.init(filters);
635 this._stackView = new Timeline.TimelineStackView(this); 636 this._stackView = new Timeline.TimelineStackView(this);
636 this._stackView.addEventListener( 637 this._stackView.addEventListener(
637 Timeline.TimelineStackView.Events.SelectionChanged, this._onStackViewSel ectionChanged, this); 638 Timeline.TimelineStackView.Events.SelectionChanged, this._onStackViewSel ectionChanged, this);
638 } 639 }
639 640
640 /** 641 /**
641 * @override 642 * @override
643 */
644 wasShown() {
645 var groupById = this._groupBySetting.get();
646 var option = this._groupByCombobox.options().find(option => option.value === groupById);
647 if (option)
648 this._groupByCombobox.select(option);
649 }
650
651 /**
652 * @override
642 * @param {!Timeline.TimelineSelection} selection 653 * @param {!Timeline.TimelineSelection} selection
643 */ 654 */
644 updateContents(selection) { 655 updateContents(selection) {
645 this._updateExtensionResolver(); 656 this._updateExtensionResolver();
646 super.updateContents(selection); 657 super.updateContents(selection);
647 var rootNode = this._dataGrid.rootNode(); 658 var rootNode = this._dataGrid.rootNode();
648 if (rootNode.children.length) 659 if (rootNode.children.length)
649 rootNode.children[0].revealAndSelect(); 660 rootNode.children[0].revealAndSelect();
650 } 661 }
651 662
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 } 716 }
706 return {name: node.id || Common.UIString('unattributed'), color: color}; 717 return {name: node.id || Common.UIString('unattributed'), color: color};
707 } 718 }
708 719
709 /** 720 /**
710 * @override 721 * @override
711 * @param {!UI.Toolbar} toolbar 722 * @param {!UI.Toolbar} toolbar
712 */ 723 */
713 populateToolbar(toolbar) { 724 populateToolbar(toolbar) {
714 super.populateToolbar(toolbar); 725 super.populateToolbar(toolbar);
715 this._groupByCombobox = new UI.ToolbarComboBox(this._onGroupByChanged.bind(t his));
716 /** 726 /**
717 * @param {string} name 727 * @param {string} name
718 * @param {string} id 728 * @param {string} id
719 * @this {Timeline.TimelineTreeView} 729 * @this {Timeline.TimelineTreeView}
720 */ 730 */
721 function addGroupingOption(name, id) { 731 function addGroupingOption(name, id) {
722 var option = this._groupByCombobox.createOption(name, '', id); 732 var option = this._groupByCombobox.createOption(name, '', id);
723 this._groupByCombobox.addOption(option); 733 this._groupByCombobox.addOption(option);
724 if (id === this._groupBySetting.get()) 734 if (id === this._groupBySetting.get())
725 this._groupByCombobox.select(option); 735 this._groupByCombobox.select(option);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 995
986 _onSelectionChanged() { 996 _onSelectionChanged() {
987 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged); 997 this.dispatchEventToListeners(Timeline.TimelineStackView.Events.SelectionCha nged);
988 } 998 }
989 }; 999 };
990 1000
991 /** @enum {symbol} */ 1001 /** @enum {symbol} */
992 Timeline.TimelineStackView.Events = { 1002 Timeline.TimelineStackView.Events = {
993 SelectionChanged: Symbol('SelectionChanged') 1003 SelectionChanged: Symbol('SelectionChanged')
994 }; 1004 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698