Changeset 92674 in webkit
- Timestamp:
- Aug 9, 2011 3:39:27 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92672 r92674 1 2011-08-09 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Add "Refresh" to context menu of resources panel cookies view. 4 https://bugs.webkit.org/show_bug.cgi?id=65854 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/CookieItemsView.js: 9 (WebInspector.CookieItemsView): 10 (WebInspector.CookieItemsView.prototype._updateWithCookies): 11 (WebInspector.CookieItemsView.prototype._refreshButtonClicked): 12 (WebInspector.CookieItemsView.prototype._contextMenu): 13 * inspector/front-end/CookiesTable.js: 14 (WebInspector.CookiesTable): 15 * inspector/front-end/DataGrid.js: 16 (WebInspector.DataGrid.prototype.get refreshCallback): 17 (WebInspector.DataGrid.prototype.set refreshCallback): 18 (WebInspector.DataGrid.prototype._contextMenuInDataTable): 19 * inspector/front-end/ResourceCookiesView.js: 20 (WebInspector.ResourceCookiesView.prototype._buildCookiesTable): 21 1 22 2011-08-09 Vsevolod Vlasov <vsevik@chromium.org> 2 23 -
trunk/Source/WebCore/inspector/front-end/CookieItemsView.js
r89577 r92674 46 46 this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This site has no cookies.")); 47 47 this._emptyView.show(this.element); 48 49 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), true); 48 50 } 49 51 … … 91 93 92 94 if (!this._cookiesTable) { 93 this._cookiesTable = isAdvanced ? new WebInspector.CookiesTable(this._cookieDomain, false, this._deleteCookie.bind(this) ) : new WebInspector.SimpleCookiesTable();95 this._cookiesTable = isAdvanced ? new WebInspector.CookiesTable(this._cookieDomain, false, this._deleteCookie.bind(this), this._update.bind(this)) : new WebInspector.SimpleCookiesTable(); 94 96 this.element.appendChild(this._cookiesTable.element); 95 97 } … … 152 154 { 153 155 this._update(); 156 }, 157 158 _contextMenu: function() 159 { 160 if (!this._cookies.length) { 161 var contextMenu = new WebInspector.ContextMenu(); 162 contextMenu.appendItem(WebInspector.UIString("Refresh"), this._update.bind(this)); 163 contextMenu.show(event); 164 } 154 165 } 155 166 } -
trunk/Source/WebCore/inspector/front-end/CookiesTable.js
r72655 r92674 29 29 */ 30 30 31 WebInspector.CookiesTable = function(cookieDomain, expandable, deleteCallback )31 WebInspector.CookiesTable = function(cookieDomain, expandable, deleteCallback, refreshCallback) 32 32 { 33 33 this._cookieDomain = cookieDomain; … … 65 65 this._dataGrid = new WebInspector.DataGrid(columns, null, deleteCallback ? this._onDeleteFromGrid.bind(this) : null); 66 66 this._dataGrid.addEventListener("sorting changed", this._rebuildTable, this); 67 this._dataGrid.refreshCallback = refreshCallback; 67 68 68 69 this.element = this._dataGrid.element; -
trunk/Source/WebCore/inspector/front-end/DataGrid.js
r86855 r92674 156 156 157 157 WebInspector.DataGrid.prototype = { 158 get refreshCallback() 159 { 160 return this._refreshCallback; 161 }, 162 163 set refreshCallback(refreshCallback) 164 { 165 this._refreshCallback = refreshCallback; 166 }, 167 158 168 _ondblclick: function(event) 159 169 { … … 879 889 _contextMenuInDataTable: function(event) 880 890 { 891 var contextMenu = new WebInspector.ContextMenu(); 892 881 893 var gridNode = this.dataGridNodeFromNode(event.target); 882 if (!gridNode || !gridNode.selectable) 883 return; 884 885 if (gridNode.isEventWithinDisclosureTriangle(event)) 886 return; 887 888 var contextMenu = new WebInspector.ContextMenu(); 889 890 // FIXME: Use the column names for Editing, instead of just "Edit". 891 if (this.dataGrid._editCallback) { 892 if (gridNode === this.creationNode) 893 contextMenu.appendItem(WebInspector.UIString("Add New"), this._startEditing.bind(this, event.target)); 894 else 895 contextMenu.appendItem(WebInspector.UIString("Edit"), this._startEditing.bind(this, event.target)); 896 } 897 if (this.dataGrid._deleteCallback && gridNode !== this.creationNode) 898 contextMenu.appendItem(WebInspector.UIString("Delete"), this._deleteCallback.bind(this, gridNode)); 894 if (this.dataGrid._refreshCallback && (!gridNode || gridNode !== this.creationNode)) 895 contextMenu.appendItem(WebInspector.UIString("Refresh"), this._refreshCallback.bind(this)); 896 897 if (gridNode && gridNode.selectable && !gridNode.isEventWithinDisclosureTriangle(event)) { 898 // FIXME: Use the column names for Editing, instead of just "Edit". 899 if (this.dataGrid._editCallback) { 900 if (gridNode === this.creationNode) 901 contextMenu.appendItem(WebInspector.UIString("Add New"), this._startEditing.bind(this, event.target)); 902 else 903 contextMenu.appendItem(WebInspector.UIString("Edit"), this._startEditing.bind(this, event.target)); 904 } 905 if (this.dataGrid._deleteCallback && gridNode !== this.creationNode) 906 contextMenu.appendItem(WebInspector.UIString("Delete"), this._deleteCallback.bind(this, gridNode)); 907 } 899 908 900 909 contextMenu.show(event); -
trunk/Source/WebCore/inspector/front-end/ResourceCookiesView.js
r89577 r92674 73 73 this.element.removeChildren(); 74 74 75 this._cookiesTable = new WebInspector.CookiesTable(null, true , true);75 this._cookiesTable = new WebInspector.CookiesTable(null, true); 76 76 this._cookiesTable.addCookiesFolder(WebInspector.UIString("Request Cookies"), this._resource.requestCookies); 77 77 this._cookiesTable.addCookiesFolder(WebInspector.UIString("Response Cookies"), this._resource.responseCookies);
Note: See TracChangeset
for help on using the changeset viewer.