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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineFlameChart.js

Issue 270693003: Timeline: make frames in TimelineView selectable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: bail out early if selection is of wrong type Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 /** 867 /**
868 * @param {?WebInspector.TimelineModel.Record} record 868 * @param {?WebInspector.TimelineModel.Record} record
869 * @param {string=} regex 869 * @param {string=} regex
870 * @param {boolean=} selectRecord 870 * @param {boolean=} selectRecord
871 */ 871 */
872 highlightSearchResult: function(record, regex, selectRecord) 872 highlightSearchResult: function(record, regex, selectRecord)
873 { 873 {
874 }, 874 },
875 875
876 /** 876 /**
877 * @param {?WebInspector.TimelineModel.Record|?WebInspector.TracingModel.Eve nt} record 877 * @param {?WebInspector.TimelineSelection} selection
878 */ 878 */
879 setSelectedRecord: function(record) 879 setSelection: function(selection)
880 { 880 {
881 if (!selection || selection.type() !== WebInspector.TimelineSelection.Ty pe.Record) {
882 this._mainView.setSelectedEntry(-1);
883 return;
884 }
885 var record = selection.object();
881 var entryRecords = this._dataProvider._records; 886 var entryRecords = this._dataProvider._records;
882 for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) { 887 for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) {
883 if (entryRecords[entryIndex] === record) { 888 if (entryRecords[entryIndex] === record) {
884 this._mainView.setSelectedEntry(entryIndex); 889 this._mainView.setSelectedEntry(entryIndex);
885 return; 890 return;
886 } 891 }
887 } 892 }
888 this._mainView.setSelectedEntry(-1); 893 this._mainView.setSelectedEntry(-1);
889 }, 894 },
890 895
891 /** 896 /**
892 * @param {!WebInspector.Event} event 897 * @param {!WebInspector.Event} event
893 */ 898 */
894 _onEntrySelected: function(event) 899 _onEntrySelected: function(event)
895 { 900 {
896 var entryIndex = event.data; 901 var entryIndex = event.data;
897 var record = this._dataProvider._records[entryIndex]; 902 var record = this._dataProvider._records[entryIndex];
898 if (record instanceof WebInspector.TimelineModel.Record) 903 if (record instanceof WebInspector.TimelineModel.Record)
899 this._delegate.selectRecord(record); 904 this._delegate.select(WebInspector.TimelineSelection.fromRecord(reco rd));
900 }, 905 },
901 906
902 __proto__: WebInspector.VBox.prototype 907 __proto__: WebInspector.VBox.prototype
903 } 908 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/CountersGraph.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698