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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineFlameChart.js
diff --git a/Source/devtools/front_end/timeline/TimelineFlameChart.js b/Source/devtools/front_end/timeline/TimelineFlameChart.js
index 6c70e09493503d41c00d374367afdaeaa6ba1683..469add57b9f78df96b8be7a3c58323e7e87b80f1 100644
--- a/Source/devtools/front_end/timeline/TimelineFlameChart.js
+++ b/Source/devtools/front_end/timeline/TimelineFlameChart.js
@@ -874,10 +874,15 @@ WebInspector.TimelineFlameChart.prototype = {
},
/**
- * @param {?WebInspector.TimelineModel.Record|?WebInspector.TracingModel.Event} record
+ * @param {?WebInspector.TimelineSelection} selection
*/
- setSelectedRecord: function(record)
+ setSelection: function(selection)
{
+ if (!selection || selection.type() !== WebInspector.TimelineSelection.Type.Record) {
+ this._mainView.setSelectedEntry(-1);
+ return;
+ }
+ var record = selection.object();
var entryRecords = this._dataProvider._records;
for (var entryIndex = 0; entryIndex < entryRecords.length; ++entryIndex) {
if (entryRecords[entryIndex] === record) {
@@ -896,7 +901,7 @@ WebInspector.TimelineFlameChart.prototype = {
var entryIndex = event.data;
var record = this._dataProvider._records[entryIndex];
if (record instanceof WebInspector.TimelineModel.Record)
- this._delegate.selectRecord(record);
+ this._delegate.select(WebInspector.TimelineSelection.fromRecord(record));
},
__proto__: WebInspector.VBox.prototype
« 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