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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js

Issue 2782953002: DevTools: Make EntryHighlighted an event rather than method on data provider (Closed)
Patch Set: clean up Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartNetworkDataProvider.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js
index d38e8a2ed1d186d9ab40a0216fcdf93ca49b119f..8a1df75f6598ef0bcd79ff73991cd98069810e54 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js
@@ -73,6 +73,7 @@ Timeline.TimelineFlameChartView = class extends UI.VBox {
this._onNetworkEntrySelected = this._onEntrySelected.bind(this, this._networkDataProvider);
this._mainFlameChart.addEventListener(PerfUI.FlameChart.Events.EntrySelected, this._onMainEntrySelected, this);
this._networkFlameChart.addEventListener(PerfUI.FlameChart.Events.EntrySelected, this._onNetworkEntrySelected, this);
+ this._mainFlameChart.addEventListener(PerfUI.FlameChart.Events.EntryHighlighted, this._onEntryHighlighted, this);
this._nextExtensionIndex = 0;
this._boundRefresh = this._refresh.bind(this);
@@ -150,6 +151,25 @@ Timeline.TimelineFlameChartView = class extends UI.VBox {
}
/**
+ * @param {!Common.Event} commonEvent
+ */
+ _onEntryHighlighted(commonEvent) {
+ SDK.DOMModel.hideDOMNodeHighlight();
+ var entryIndex = /** @type {number} */ (commonEvent.data);
+ var event = this._mainDataProvider.eventByIndex(entryIndex);
+ if (!event)
+ return;
+ var target = this._model && this._model.timelineModel().targetByEvent(event);
+ if (!target)
+ return;
+ var timelineData = TimelineModel.TimelineData.forEvent(event);
+ var backendNodeId = timelineData.backendNodeId;
+ if (!backendNodeId)
+ return;
+ new SDK.DeferredDOMNode(target, backendNodeId).highlight();
+ }
+
+ /**
* @override
* @param {?SDK.TracingModel.Event} event
*/
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartNetworkDataProvider.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698