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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.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/ResourceWebSocketFrameView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
index 0610535e819af42c26346d6b063d4194e11911b5..3ce6a0abaf1a1720df4a7afd9705e56a87e2f5ad 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
@@ -37,7 +37,8 @@ WebInspector.ResourceWebSocketFrameView = function(request)
{id: "time", title: WebInspector.UIString("Time"), sortable: true, weight: 7}
]);
- this._dataGrid = new WebInspector.SortableDataGrid(columns, undefined, undefined, undefined, this._onContextMenu.bind(this));
+ this._dataGrid = new WebInspector.SortableDataGrid(columns);
+ this._dataGrid.setRowContextMenuCallback(onRowContextMenu);
this._dataGrid.setStickToBottom(true);
this._dataGrid.setCellClass("websocket-frame-view-td");
this._timeComparator = /** @type {!WebInspector.SortableDataGrid.NodeComparator} */ (WebInspector.ResourceWebSocketFrameNodeTimeComparator);
@@ -55,6 +56,15 @@ WebInspector.ResourceWebSocketFrameView = function(request)
/** @type {?WebInspector.ResourceWebSocketFrameNode} */
this._selectedNode = null;
+
+ /**
+ * @param {!WebInspector.ContextMenu} contextMenu
+ * @param {!WebInspector.DataGridNode} node
+ */
+ function onRowContextMenu(contextMenu, node)
+ {
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^message"), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, node.data.data))
+ }
};
/** @enum {number} */
@@ -165,23 +175,6 @@ WebInspector.ResourceWebSocketFrameView.prototype = {
this._dataGrid.insertChild(new WebInspector.ResourceWebSocketFrameNode(this._request.url, frames[i]));
},
- /**
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {!WebInspector.DataGridNode} node
- */
- _onContextMenu: function(contextMenu, node)
- {
- contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^message"), this._copyMessage.bind(this, node.data));
- },
-
- /**
- * @param {!Object} row
- */
- _copyMessage: function(row)
- {
- InspectorFrontendHost.copyText(row.data);
- },
-
_sortItems: function()
{
this._dataGrid.sortNodes(this._timeComparator, !this._dataGrid.isSortOrderAscending());

Powered by Google App Engine
This is Rietveld 408576698