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

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

Issue 2510493002: Timeline: add support for jumping to frame for aggregated trees (Closed)
Patch Set: Timeline: add support for jumping to frame for aggregated trees Created 4 years, 1 month 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 | « no previous file | 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/TimelineTreeView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
index 04f2402806f8bac52547a417508dda43d0c8a03b..f5eb97bd42a7c2698350aa32c27cc443eeb92e2b 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js
@@ -41,6 +41,7 @@ Timeline.TimelineTreeView = class extends UI.VBox {
this._dataGrid.addEventListener(UI.DataGrid.Events.SortingChanged, this._sortingChanged, this);
this._dataGrid.element.addEventListener('mousemove', this._onMouseMove.bind(this), true);
this._dataGrid.setResizeMethod(UI.DataGrid.ResizeMethod.Last);
+ this._dataGrid.setRowContextMenuCallback(this._onContextMenu.bind(this));
this._dataGrid.asWidget().show(mainView.element);
this._splitWidget = new UI.SplitWidget(true, true, 'timelineTreeViewDetailsSplitWidget');
@@ -93,6 +94,13 @@ Timeline.TimelineTreeView = class extends UI.VBox {
}
/**
+ * @param {!UI.ContextMenu} contextMenu
+ * @param {!TimelineModel.TimelineProfileTree.Node} node
+ */
+ _appendContextMenuItems(contextMenu, node) {
alph 2016/11/16 02:29:21 We do not start protected functions with _. don't
+ }
+
+ /**
* @param {!SDK.TracingModel.Event} event
* @return {?Element}
*/
@@ -272,6 +280,17 @@ Timeline.TimelineTreeView = class extends UI.VBox {
}
/**
+ * @param {!UI.ContextMenu} contextMenu
+ * @param {!UI.DataGridNode} gridNode
+ */
+ _onContextMenu(contextMenu, gridNode) {
+ var profileNode = gridNode._profileNode;
+ if (!profileNode)
+ return;
+ this._appendContextMenuItems(contextMenu, profileNode);
+ }
+
+ /**
* @param {!TimelineModel.TimelineProfileTree.Node} treeNode
* @return {?Timeline.TimelineTreeView.GridNode}
*/
@@ -650,6 +669,21 @@ Timeline.AggregatedTimelineTreeView = class extends Timeline.TimelineTreeView {
return () => Symbol('uniqueGroupId');
}
}
+ /**
+ * @override
+ * @param {!UI.ContextMenu} contextMenu
+ * @param {!TimelineModel.TimelineProfileTree.Node} node
+ */
+ _appendContextMenuItems(contextMenu, node) {
+ if (this._groupBySetting.get() !== Timeline.AggregatedTimelineTreeView.GroupBy.Frame)
+ return;
+ if (!node.isGroupNode())
+ return;
+ var frame = this._model.pageFrameById(node.id);
+ if (!frame || !frame.ownerNode)
+ return;
+ contextMenu.appendApplicableItems(frame.ownerNode);
+ }
/**
* @param {string} url
« 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