| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {!WebInspector.NetworkLogView} networkLogView | 7 * @param {!WebInspector.NetworkLogView} networkLogView |
| 8 * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator | 8 * @param {!WebInspector.NetworkTransferTimeCalculator} timeCalculator |
| 9 * @param {!WebInspector.NetworkTransferDurationCalculator} durationCalculator | 9 * @param {!WebInspector.NetworkTransferDurationCalculator} durationCalculator |
| 10 * @param {!WebInspector.Setting} networkLogLargeRowsSetting | 10 * @param {!WebInspector.Setting} networkLogLargeRowsSetting |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) { | 454 if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) { |
| 455 this._splitWidget = new WebInspector.SplitWidget(true, false, "netwo
rkPanelSplitViewTimeline"); | 455 this._splitWidget = new WebInspector.SplitWidget(true, false, "netwo
rkPanelSplitViewTimeline"); |
| 456 this._splitWidget.setSidebarWidget(this._dataGrid.asWidget()); | 456 this._splitWidget.setSidebarWidget(this._dataGrid.asWidget()); |
| 457 } | 457 } |
| 458 }, | 458 }, |
| 459 | 459 |
| 460 _setupTimeline: function() | 460 _setupTimeline: function() |
| 461 { | 461 { |
| 462 this._timelineColumn = new WebInspector.NetworkTimelineColumn(this._netw
orkLogView.rowHeight(), this._networkLogView.calculator()); | 462 this._timelineColumn = new WebInspector.NetworkTimelineColumn(this._netw
orkLogView.rowHeight(), this._networkLogView.calculator()); |
| 463 | 463 |
| 464 this._timelineColumn.element.addEventListener("contextmenu", handleConte
xtMenu.bind(this)); |
| 464 this._timelineColumn.element.addEventListener("mousewheel", this._onMous
eWheel.bind(this, false), { passive: true }); | 465 this._timelineColumn.element.addEventListener("mousewheel", this._onMous
eWheel.bind(this, false), { passive: true }); |
| 465 this._dataGridScroller.addEventListener("mousewheel",this._onMouseWheel.
bind(this, true), true); | 466 this._dataGridScroller.addEventListener("mousewheel",this._onMouseWheel.
bind(this, true), true); |
| 466 | 467 |
| 467 this._timelineColumn.element.addEventListener("mousemove", event => this
._networkLogView.setHoveredRequest(this._timelineColumn.getRequestFromPoint(even
t.offsetX, event.offsetY + event.target.offsetTop)), true); | 468 this._timelineColumn.element.addEventListener("mousemove", event => this
._networkLogView.setHoveredRequest(this._timelineColumn.getRequestFromPoint(even
t.offsetX, event.offsetY + event.target.offsetTop)), true); |
| 468 this._timelineColumn.element.addEventListener("mouseleave", this._networ
kLogView.setHoveredRequest.bind(this._networkLogView, null), true); | 469 this._timelineColumn.element.addEventListener("mouseleave", this._networ
kLogView.setHoveredRequest.bind(this._networkLogView, null), true); |
| 469 | 470 |
| 470 this._timelineScroller = this._timelineColumn.contentElement.createChild
("div", "network-timeline-v-scroll"); | 471 this._timelineScroller = this._timelineColumn.contentElement.createChild
("div", "network-timeline-v-scroll"); |
| 471 this._timelineScroller.addEventListener("scroll", this._syncScrollers.bi
nd(this), { passive: true }); | 472 this._timelineScroller.addEventListener("scroll", this._syncScrollers.bi
nd(this), { passive: true }); |
| 472 this._timelineScrollerContent = this._timelineScroller.createChild("div"
, "network-timeline-v-scroll-content"); | 473 this._timelineScrollerContent = this._timelineScroller.createChild("div"
, "network-timeline-v-scroll-content"); |
| 473 | 474 |
| 474 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChan
ged, () => { | 475 this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChan
ged, () => { |
| 475 this._timelineScrollerWidthIsStale = true; | 476 this._timelineScrollerWidthIsStale = true; |
| 476 this._syncScrollers(); | 477 this._syncScrollers(); |
| 477 }); | 478 }); |
| 478 this._dataGrid.addEventListener(WebInspector.ViewportDataGrid.Events.Vie
wportCalculated, this._redrawTimelineColumn.bind(this)); | 479 this._dataGrid.addEventListener(WebInspector.ViewportDataGrid.Events.Vie
wportCalculated, this._redrawTimelineColumn.bind(this)); |
| 479 | 480 |
| 480 | 481 |
| 481 this._createTimelineHeader(); | 482 this._createTimelineHeader(); |
| 482 this._timelineColumn.contentElement.classList.add("network-timeline-view
"); | 483 this._timelineColumn.contentElement.classList.add("network-timeline-view
"); |
| 483 | 484 |
| 484 this._splitWidget.setMainWidget(this._timelineColumn); | 485 this._splitWidget.setMainWidget(this._timelineColumn); |
| 485 | 486 |
| 486 this.switchViewMode(false); | 487 this.switchViewMode(false); |
| 488 |
| 489 /** |
| 490 * @param {!Event} event |
| 491 * @this {WebInspector.NetworkLogViewColumns} |
| 492 */ |
| 493 function handleContextMenu(event) |
| 494 { |
| 495 var request = this._timelineColumn.getRequestFromPoint(event.offsetX
, event.offsetY); |
| 496 if (!request) |
| 497 return; |
| 498 var contextMenu = new WebInspector.ContextMenu(event); |
| 499 this._networkLogView.handleContextMenuForRequest(contextMenu, reques
t); |
| 500 } |
| 487 }, | 501 }, |
| 488 | 502 |
| 489 /** | 503 /** |
| 490 * @param {boolean} shouldConsume | 504 * @param {boolean} shouldConsume |
| 491 * @param {!Event} event | 505 * @param {!Event} event |
| 492 */ | 506 */ |
| 493 _onMouseWheel: function(shouldConsume, event) | 507 _onMouseWheel: function(shouldConsume, event) |
| 494 { | 508 { |
| 495 if (shouldConsume) | 509 if (shouldConsume) |
| 496 event.consume(true); | 510 event.consume(true); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 { | 1116 { |
| 1103 if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) { | 1117 if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) { |
| 1104 this._shownEventDividers.delete(WebInspector.NetworkLogViewColumns._
filmStripDividerColor); | 1118 this._shownEventDividers.delete(WebInspector.NetworkLogViewColumns._
filmStripDividerColor); |
| 1105 this._redrawTimelineColumn(); | 1119 this._redrawTimelineColumn(); |
| 1106 return; | 1120 return; |
| 1107 } | 1121 } |
| 1108 for (var divider of this._eventDividers) | 1122 for (var divider of this._eventDividers) |
| 1109 divider.element.classList.toggle("network-frame-divider-selected", f
alse); | 1123 divider.element.classList.toggle("network-frame-divider-selected", f
alse); |
| 1110 } | 1124 } |
| 1111 }; | 1125 }; |
| OLD | NEW |