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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.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/components_lazy/CookiesTable.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js
index 01fbd9899539405c5d4ea92631ab8ca8e7741423..8303788c78e9f0f56ea677f066a27996fcb861ec 100644
--- a/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js
+++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/CookiesTable.js
@@ -56,8 +56,10 @@ WebInspector.CookiesTable = function(expandable, refreshCallback, selectedCallba
if (readOnly)
lushnikov 2016/10/26 02:36:34 nit: braces
allada 2016/10/26 02:45:08 Done.
this._dataGrid = new WebInspector.DataGrid(columns);
- else
- this._dataGrid = new WebInspector.DataGrid(columns, undefined, this._onDeleteCookie.bind(this), refreshCallback, this._onContextMenu.bind(this));
+ else {
+ this._dataGrid = new WebInspector.DataGrid(columns, undefined, this._onDeleteCookie.bind(this), refreshCallback);
+ this._dataGrid.addEventListener(WebInspector.DataGrid.Events.RowContextMenu, this._onRowContextMenu.bind(this));
+ }
this._dataGrid.setName("cookiesTable");
this._dataGrid.addEventListener(WebInspector.DataGrid.Events.SortingChanged, this._rebuildTable, this);
@@ -82,15 +84,15 @@ WebInspector.CookiesTable.prototype = {
},
/**
- * @param {!WebInspector.ContextMenu} contextMenu
- * @param {!WebInspector.DataGridNode} node
+ * @param {!WebInspector.Event} event
*/
- _onContextMenu: function(contextMenu, node)
+ _onRowContextMenu: function(event)
{
+ var contextMenu = /** @type {!WebInspector.ContextMenu} */ (event.data.contextMenu);
+ var node = /** @type {!WebInspector.DataGridNode} */ (event.data.node);
if (node === this._dataGrid.creationNode)
return;
- var cookie = node.cookie;
- var domain = cookie.domain();
+ var domain = node.cookie.domain();
if (domain)
contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all from \"%s\"", domain), this._clearAndRefresh.bind(this, domain));
contextMenu.appendItem(WebInspector.UIString.capitalize("Clear ^all"), this._clearAndRefresh.bind(this, null));

Powered by Google App Engine
This is Rietveld 408576698