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

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

Issue 2443683002: [Devtools] Move NetworkTimelineColumn into NetworkLogViewColumns P1 (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/NetworkLogViewColumns.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 21065e4c2734ce0b9917ff60c0e6363d8cbb7b50..4a33e8dc1b1b25b7690931de3a5c052998c744ea 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -51,7 +51,12 @@ WebInspector.NetworkLogView = function(filterBar, progressBarContainer, networkL
this._progressBarContainer = progressBarContainer;
this._networkLogLargeRowsSetting = networkLogLargeRowsSetting;
- this._columns = new WebInspector.NetworkLogViewColumns(this, networkLogLargeRowsSetting);
+ /** @type {!WebInspector.NetworkTransferTimeCalculator} */
+ this._timeCalculator = new WebInspector.NetworkTransferTimeCalculator();
+ /** @type {!WebInspector.NetworkTransferDurationCalculator} */
+ this._durationCalculator = new WebInspector.NetworkTransferDurationCalculator();
+ this._calculator = this._timeCalculator;
+ this._columns = new WebInspector.NetworkLogViewColumns(this, this._timeCalculator, this._durationCalculator, networkLogLargeRowsSetting);
/** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */
this._nodesByRequestId = new Map();
@@ -274,43 +279,29 @@ WebInspector.NetworkLogView.prototype = {
_initializeView: function()
{
this.element.id = "network-container";
-
- /** @type {!WebInspector.NetworkTransferTimeCalculator} */
- this._timeCalculator = new WebInspector.NetworkTransferTimeCalculator();
- /** @type {!WebInspector.NetworkTransferDurationCalculator} */
- this._durationCalculator = new WebInspector.NetworkTransferDurationCalculator();
- this._calculator = this._timeCalculator;
-
+ this._setupDataGrid();
if (Runtime.experiments.isEnabled("canvasNetworkTimeline")) {
- this._splitWidget = new WebInspector.SplitWidget(true, false, "networkPanelSplitViewTimeline");
- this._splitWidget.show(this.element);
- this._createTable();
- this._splitWidget.setSidebarWidget(this._dataGrid.asWidget());
-
- this._summaryBarElement = this.element.createChild("div", "network-summary-bar");
-
- this._timelineWidget = new WebInspector.VBox();
- this._createTimelineHeader();
- this._timelineWidget.element.classList.add("network-timeline-view");
- this._splitWidget.setMainWidget(this._timelineWidget);
-
- this._timelineColumn = new WebInspector.NetworkTimelineColumn(this._rowHeight, this._headerHeight, this._calculator, this._dataGrid.scrollContainer);
-
var dataGridScroller = this._dataGrid.scrollContainer;
+ this._timelineColumn = new WebInspector.NetworkTimelineColumn(this._rowHeight, this._headerHeight, this._calculator, dataGridScroller);
this._dataGrid.setScrollContainer(this._timelineColumn.getScrollContainer());
- this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChanged, () => {
- this._timelineColumn.setScrollHeight(dataGridScroller.scrollHeight);
- });
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Events.PaddingChanged, () => this._timelineColumn.setScrollHeight(dataGridScroller.scrollHeight));
this._dataGrid.addEventListener(WebInspector.ViewportDataGrid.Events.ViewportCalculated, this._redrawTimelineColumn.bind(this));
this._timelineColumn.addEventListener(WebInspector.NetworkTimelineColumn.Events.RequestHovered, requestHovered.bind(this));
- this._timelineColumn.show(this._timelineWidget.element);
+
+ // TODO(allada) This code needs to be moved into NetworkLogViewColumns.
+ this._createTimelineHeader();
+ this._timelineColumn.contentElement.classList.add("network-timeline-view");
+
+ this._splitWidget = this._columns.splitWidget();
+ this._splitWidget.setMainWidget(this._timelineColumn);
+
+ this._columns.show(this.element);
this.switchViewMode(false);
} else {
- this._createTable();
- this._dataGrid.asWidget().show(this.element);
- this._summaryBarElement = this.element.createChild("div", "network-summary-bar");
+ this._columns.show(this.element);
}
+ this._summaryBarElement = this.element.createChild("div", "network-summary-bar");
this._columns.sortByCurrentColumn();
this._updateRowsSize();
@@ -384,9 +375,9 @@ WebInspector.NetworkLogView.prototype = {
return [this._dataGrid.scrollContainer];
},
- _createTable: function()
+ _setupDataGrid: function()
{
- this._dataGrid = this._columns.createGrid(this._timeCalculator, this._durationCalculator);
+ this._dataGrid = this._columns.dataGrid();
this._dataGrid.setRowContextMenuCallback(this._onRowContextMenu.bind(this));
this._dataGrid.setStickToBottom(true);
this._dataGrid.setName("networkLog");
@@ -911,7 +902,7 @@ WebInspector.NetworkLogView.prototype = {
_createTimelineHeader: function()
{
- this._timelineHeaderElement = this._timelineWidget.element.createChild("div", "network-timeline-header");
+ this._timelineHeaderElement = this._timelineColumn.contentElement.createChild("div", "network-timeline-header");
this._timelineHeaderElement.addEventListener("click", timelineHeaderClicked.bind(this));
this._timelineHeaderElement.addEventListener("contextmenu", this._columns.headerContextMenuEvent.bind(this._columns));
var innerElement = this._timelineHeaderElement.createChild("div");
@@ -936,13 +927,6 @@ WebInspector.NetworkLogView.prototype = {
switchViewMode: function(gridMode)
{
this._columns.switchViewMode(gridMode);
- if (!Runtime.experiments.isEnabled("canvasNetworkTimeline"))
- return;
-
- if (gridMode && this._nodesByRequestId.size)
- this._splitWidget.showBoth();
- else
- this._splitWidget.hideMain();
},
/**
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698