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..371391858e87d100144b69f907349c1da21dd321 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.addEventListener(WebInspector.DataGrid.Events.RowContextMenu, onRowContextMenu); |
this._dataGrid.setStickToBottom(true); |
this._dataGrid.setCellClass("websocket-frame-view-td"); |
this._timeComparator = /** @type {!WebInspector.SortableDataGrid.NodeComparator} */ (WebInspector.ResourceWebSocketFrameNodeTimeComparator); |
@@ -55,6 +56,16 @@ WebInspector.ResourceWebSocketFrameView = function(request) |
/** @type {?WebInspector.ResourceWebSocketFrameNode} */ |
this._selectedNode = null; |
+ |
+ /** |
+ * @param {!WebInspector.Event} event |
+ */ |
+ function onRowContextMenu(event) |
+ { |
+ var contextMenu = /** @type {!WebInspector.ContextMenu} */ (event.data.contextMenu); |
+ var node = /** @type {!WebInspector.DataGridNode} */ (event.data.node); |
+ contextMenu.appendItem(WebInspector.UIString.capitalize("Copy ^message"), InspectorFrontendHost.copyText.bind(InspectorFrontendHost, node.data.data)) |
+ } |
}; |
/** @enum {number} */ |
@@ -165,23 +176,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()); |