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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2412013002: [Devtools] Added hover support for network timeline experiment (Closed)
Patch Set: Changes Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index b3965fd96b56633ff16bd236fa27dcdf124af2ce..0aadc9d7dcd01c5cf412f7363c7bb9e6ed35102c 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -294,6 +294,7 @@ WebInspector.NetworkLogView.prototype = {
this._splitWidget.setMainWidget(this._timelineWidget);
this._timelineColumn = new WebInspector.NetworkTimelineColumn(this, this._dataGrid);
+ this._timelineColumn.addEventListener(WebInspector.NetworkTimelineColumn.Events.RequestHovered, requestHovered.bind(this));
this._timelineColumn.show(this._timelineWidget.element);
this.switchViewMode(false);
} else {
@@ -304,6 +305,17 @@ WebInspector.NetworkLogView.prototype = {
this._columns.sortByCurrentColumn();
this._updateRowsSize();
+
+ /**
+ * @param {!WebInspector.Event} event
+ * @this {WebInspector.NetworkLogView}
+ */
+ function requestHovered(event)
+ {
+ var request = /** @type {?WebInspector.NetworkRequest} */ (event.data);
+ var node = request ? this._nodesByRequestId.get(request.requestId) : null;
+ this._setHoveredNode(node || null);
+ }
},
_showRecordingHint: function()
@@ -354,25 +366,45 @@ WebInspector.NetworkLogView.prototype = {
this._dataGrid.element.addEventListener("contextmenu", this._contextMenu.bind(this), true);
this._dataGrid.element.addEventListener("mousedown", this._dataGridMouseDown.bind(this), true);
this._dataGrid.element.addEventListener("mousemove", this._dataGridMouseMove.bind(this), true);
- this._dataGrid.element.addEventListener("mouseleave", this._highlightInitiatorChain.bind(this, null), true);
+ this._dataGrid.element.addEventListener("mouseleave", this._dataGridMouseLeave.bind(this), true);
},
/**
* @param {!Event} event
*/
- _dataGridMouseDown: function(event)
+ _dataGridMouseMove: function(event)
{
- if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosingNodeOrSelfWithNodeName("a"))
- event.consume();
+ var node = this._dataGrid.dataGridNodeFromNode(event.target);
+ this._setHoveredNode(node);
+ this._highlightInitiatorChain((event.shiftKey && node) ? node.request() : null);
+ },
+
+ _dataGridMouseLeave: function()
+ {
+ this._setHoveredNode(null);
+ this._highlightInitiatorChain(null);
+ },
+
+ /**
+ * @param {?WebInspector.NetworkDataGridNode} node
+ */
+ _setHoveredNode: function(node)
+ {
+ if (this._hoveredNode)
+ this._hoveredNode.element().classList.remove("hover");
+ this._hoveredNode = node;
+ if (this._hoveredNode)
+ this._hoveredNode.element().classList.add("hover");
+ this._timelineColumn.setHoveredRequest(this._hoveredNode ? this._hoveredNode.request() : null);
},
/**
* @param {!Event} event
*/
- _dataGridMouseMove: function(event)
+ _dataGridMouseDown: function(event)
{
- var node = event.shiftKey ? this._dataGrid.dataGridNodeFromNode(event.target) : null;
- this._highlightInitiatorChain(node ? node.request() : null);
+ if ((!this._dataGrid.selectedNode && event.button) || event.target.enclosingNodeOrSelfWithNodeName("a"))
+ event.consume();
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698