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

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

Issue 2412013002: [Devtools] Added hover support for network timeline experiment (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 _createTable: function() 347 _createTable: function()
348 { 348 {
349 this._dataGrid = this._columns.createGrid(this._timeCalculator, this._du rationCalculator); 349 this._dataGrid = this._columns.createGrid(this._timeCalculator, this._du rationCalculator);
350 this._dataGrid.setStickToBottom(true); 350 this._dataGrid.setStickToBottom(true);
351 this._dataGrid.setName("networkLog"); 351 this._dataGrid.setName("networkLog");
352 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last); 352 this._dataGrid.setResizeMethod(WebInspector.DataGrid.ResizeMethod.Last);
353 this._dataGrid.element.classList.add("network-log-grid"); 353 this._dataGrid.element.classList.add("network-log-grid");
354 this._dataGrid.element.addEventListener("contextmenu", this._contextMenu .bind(this), true); 354 this._dataGrid.element.addEventListener("contextmenu", this._contextMenu .bind(this), true);
355 this._dataGrid.element.addEventListener("mousedown", this._dataGridMouse Down.bind(this), true); 355 this._dataGrid.element.addEventListener("mousedown", this._dataGridMouse Down.bind(this), true);
356 this._dataGrid.element.addEventListener("mousemove", this._dataGridMouse Move.bind(this), true); 356 this._dataGrid.element.addEventListener("mousemove", this._dataGridMouse Move.bind(this), true);
357 this._dataGrid.element.addEventListener("mouseleave", this._highlightIni tiatorChain.bind(this, null), true); 357 this._dataGrid.element.addEventListener("mouseleave", this._dataGridMous eLeave.bind(this, null), true);
358 },
359
360 /**
361 * @param {!Event} event
362 */
363 _dataGridMouseMove: function(event)
dgozman 2016/10/12 17:31:32 Where do you disable default data grid highlight?
allada 2016/10/12 19:15:29 There isnt a default highlight... Network panel di
364 {
365 var node = this._dataGrid.dataGridNodeFromNode(event.target);
dgozman 2016/10/12 17:31:32 Just call this._setHoveredNode(node)
allada 2016/10/12 19:15:29 Done.
366 if (this._hoveredNode)
367 this._hoveredNode.element().classList.remove("hover");
368 this._hoveredNode = node;
369 if (this._hoveredNode)
370 this._hoveredNode.element().classList.add("hover");
371 this._timelineColumn.setHoveredRequest(this._hoveredNode ? this._hovered Node.request() : null);
372 this._highlightInitiatorChain((event.shiftKey && node) ? node.request() : null);
373 },
374
375 _dataGridMouseLeave: function(event)
dgozman 2016/10/12 17:31:32 JSDocs
allada 2016/10/12 19:15:29 Done.
376 {
377 if (this._hoveredNode) {
378 this._hoveredNode.element().classList.remove("hover");
379 this._hoveredNode = null;
380 this._timelineColumn.setHoveredRequest(null);
381 }
382 this._highlightInitiatorChain(null);
383 },
384
385 setHoveredRequest: function(request)
386 {
387 var requestId = null;
388 if (request)
389 requestId = request.requestId;
390 this._setHoveredNode(this._nodesByRequestId.get(requestId) || null);
391 },
392
393 _setHoveredNode: function(node)
394 {
395 if (this._hoveredNode)
396 this._hoveredNode.element().classList.remove("hover");
397 this._hoveredNode = node;
398 if (this._hoveredNode)
399 this._hoveredNode.element().classList.add("hover");
400 this._timelineColumn.setHoveredRequest(this._hoveredNode ? this._hovered Node.request() : null);
358 }, 401 },
359 402
360 /** 403 /**
361 * @param {!Event} event 404 * @param {!Event} event
362 */ 405 */
363 _dataGridMouseDown: function(event) 406 _dataGridMouseDown: function(event)
364 { 407 {
365 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclo singNodeOrSelfWithNodeName("a")) 408 if ((!this._dataGrid.selectedNode && event.button) || event.target.enclo singNodeOrSelfWithNodeName("a"))
366 event.consume(); 409 event.consume();
367 }, 410 },
368 411
369 /** 412 /**
370 * @param {!Event} event
371 */
372 _dataGridMouseMove: function(event)
373 {
374 var node = event.shiftKey ? this._dataGrid.dataGridNodeFromNode(event.ta rget) : null;
375 this._highlightInitiatorChain(node ? node.request() : null);
376 },
377
378 /**
379 * @param {?WebInspector.NetworkRequest} request 413 * @param {?WebInspector.NetworkRequest} request
380 */ 414 */
381 _highlightInitiatorChain: function(request) 415 _highlightInitiatorChain: function(request)
382 { 416 {
383 if (this._requestWithHighlightedInitiators === request) 417 if (this._requestWithHighlightedInitiators === request)
384 return; 418 return;
385 this._requestWithHighlightedInitiators = request; 419 this._requestWithHighlightedInitiators = request;
386 420
387 if (!request) { 421 if (!request) {
388 for (var node of this._nodesByRequestId.values()) { 422 for (var node of this._nodesByRequestId.values()) {
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 * @return {boolean} 1851 * @return {boolean}
1818 */ 1852 */
1819 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request) 1853 WebInspector.NetworkLogView._requestTimeFilter = function(windowStart, windowEnd , request)
1820 { 1854 {
1821 if (request.issueTime() > windowEnd) 1855 if (request.issueTime() > windowEnd)
1822 return false; 1856 return false;
1823 if (request.endTime !== -1 && request.endTime < windowStart) 1857 if (request.endTime !== -1 && request.endTime < windowStart)
1824 return false; 1858 return false;
1825 return true; 1859 return true;
1826 } 1860 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698