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

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

Issue 753103002: DevTools: NetworkPanel: add hide columns button. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: UI uodate Created 6 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: Source/devtools/front_end/network/NetworkLogView.js
diff --git a/Source/devtools/front_end/network/NetworkLogView.js b/Source/devtools/front_end/network/NetworkLogView.js
index 14660d4d08e955434d563f2cbc23cd13d8a328e7..4971b2afab4acfc0a21d554035d4d93c765dccbd 100644
--- a/Source/devtools/front_end/network/NetworkLogView.js
+++ b/Source/devtools/front_end/network/NetworkLogView.js
@@ -44,6 +44,7 @@ WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting)
this._filterBar = filterBar;
this._coulmnsVisibilitySetting = coulmnsVisibilitySetting;
+ this._hideColumnsSetting = WebInspector.settings.createSetting("networkLogHideColumns", false);
/** @type {!Map.<string, !WebInspector.NetworkDataGridNode>} */
this._nodesByRequestId = new Map();
/** @type {!Object.<string, boolean>} */
@@ -240,6 +241,7 @@ WebInspector.NetworkLogView.prototype = {
this._clearButton,
this._filterBar.filterButton(),
this._largerRequestsButton,
+ this._hideColumnsButton,
this._preserveLogCheckbox,
this._disableCacheCheckbox,
new WebInspector.StatusBarItem(this._progressBarContainer) ];
@@ -468,6 +470,25 @@ WebInspector.NetworkLogView.prototype = {
this._timelineSortSelector = timelineSorting;
},
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _clickHideColumnsButton: function(event)
+ {
+ this._toggleHideColumnsButton(!this._hideColumnsSetting.get());
+ },
+
+ /**
+ * @param {boolean} toggled
+ */
+ _toggleHideColumnsButton: function(toggled)
+ {
+ this._hideColumnsSetting.set(toggled);
+ this._hideColumnsButton.title = toggled ? WebInspector.UIString("Show columns.") : WebInspector.UIString("Hide columns.");
+ this._hideColumnsButton.setToggled(toggled);
+ this._updateColumns();
+ },
+
_createSortingFunctions: function()
{
this._sortingFunctions = {};
@@ -714,6 +735,10 @@ WebInspector.NetworkLogView.prototype = {
this._largerRequestsButton.setToggled(WebInspector.settings.resourcesLargeRows.get());
this._largerRequestsButton.addEventListener("click", this._toggleLargerRequests, this);
+ this._hideColumnsButton = new WebInspector.StatusBarButton("", "waterfall-status-bar-item");
+ this._toggleHideColumnsButton(this._hideColumnsSetting.get());
+ this._hideColumnsButton.addEventListener("click", this._clickHideColumnsButton, this);
+
this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspector.UIString("Preserve log"));
this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation.");
@@ -991,7 +1016,10 @@ WebInspector.NetworkLogView.prototype = {
this._updateColumns();
},
- _toggleLargerRequests: function()
+ /**
+ * @param {!WebInspector.Event=} event
+ */
+ _toggleLargerRequests: function(event)
{
WebInspector.settings.resourcesLargeRows.set(!WebInspector.settings.resourcesLargeRows.get());
this._updateRowsSize();
@@ -1106,10 +1134,13 @@ WebInspector.NetworkLogView.prototype = {
_updateColumns: function()
{
+ if (!this._dataGrid)
+ return;
var gridMode = this._gridMode;
var visibleColumns = {"name": true};
- if (gridMode) {
+ if (gridMode)
visibleColumns["timeline"] = true;
+ if (gridMode && !this._hideColumnsSetting.get()) {
var columnsVisibility = this._coulmnsVisibilitySetting.get();
for (var columnIdentifier in columnsVisibility)
visibleColumns[columnIdentifier] = columnsVisibility[columnIdentifier];
« 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