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

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

Issue 2447933002: [Devtools] Restructured contextMenu for DataGrid. (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
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js
index 20bef332b149f358f2d4d62f4f8fc7371d46dfe4..7d1f42ad0c9bc244cc7526bc58ca33cc516ee237 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogViewColumns.js
@@ -409,6 +409,7 @@ WebInspector.NetworkLogViewColumns.prototype = {
this._updateColumns();
this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._sortHandler, this);
this._dataGrid.addEventListener(WebInspector.DataGrid.Events.ColumnsResized, this.updateDividersIfNeeded, this);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Events.HeaderContextMenu, event => this._innerHeaderContextMenu(/** @type {!WebInspector.ContextMenu} */ (event.data)));
this._timelineGrid = new WebInspector.TimelineGrid();
this._timelineGrid.element.classList.add("network-timeline-grid");
@@ -581,16 +582,20 @@ WebInspector.NetworkLogViewColumns.prototype = {
},
/**
- * @param {!Event} event
- * @return {boolean}
+ * @param {!MouseEvent} event
*/
- contextMenu: function(event)
+ headerContextMenuEvent: function(event)
{
- if (!this._gridMode || !event.target.isSelfOrDescendant(this._dataGrid.headerTableBody()))
- return false;
+ // TODO(allada) Remove this entire function when new timeline moves to this file.
+ this._innerHeaderContextMenu(new WebInspector.ContextMenu(event));
+ },
+ /**
+ * @param {!WebInspector.ContextMenu} contextMenu
+ */
+ _innerHeaderContextMenu: function(contextMenu)
+ {
var columnConfigs = this._columns.filter(columnConfig => columnConfig.hideable);
- var contextMenu = new WebInspector.ContextMenu(event);
var nonResponseHeaders = columnConfigs.filter(columnConfig => !columnConfig.isResponseHeader);
for (var columnConfig of nonResponseHeaders)
contextMenu.appendCheckboxItem(columnConfig.title, this._toggleColumnVisibility.bind(this, columnConfig), columnConfig.visible);
@@ -606,7 +611,6 @@ WebInspector.NetworkLogViewColumns.prototype = {
responseSubMenu.appendItem(WebInspector.UIString("Manage Header Columns\u2026"), this._manageCustomHeaderDialog.bind(this));
contextMenu.show();
- return true;
},
_manageCustomHeaderDialog: function()

Powered by Google App Engine
This is Rietveld 408576698