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

Unified Diff: Source/devtools/front_end/resources/ServiceWorkerCacheViews.js

Issue 1111563006: [CacheStorage] Entry deletion and cache refresh in Inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test and comments Created 5 years, 8 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: Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
diff --git a/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js b/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
index 3b0050c8075fe6bc4c3cfb5426206ac08d662d36..6116465fe7807cb718f94578ac66cb20fd121557 100644
--- a/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
+++ b/Source/devtools/front_end/resources/ServiceWorkerCacheViews.js
@@ -41,7 +41,7 @@ WebInspector.ServiceWorkerCacheView.prototype = {
columns.push({id: "request", title: WebInspector.UIString("Request")});
columns.push({id: "response", title: WebInspector.UIString("Response")});
- var dataGrid = new WebInspector.DataGrid(columns);
+ var dataGrid = new WebInspector.DataGrid(columns, undefined, this._deleteButtonClicked.bind(this), this._updateData.bind(this, true));
return dataGrid;
},
@@ -73,6 +73,14 @@ WebInspector.ServiceWorkerCacheView.prototype = {
},
/**
+ * @param {!WebInspector.DataGridNode} node
+ */
+ _deleteButtonClicked: function(node)
+ {
+ this._model.deleteCacheEntry(this._cache, node.data["request"], node.remove.bind(node));
+ },
+
+ /**
* @param {!WebInspector.ServiceWorkerCacheModel.Cache} cache
*/
update: function(cache)
@@ -162,7 +170,7 @@ WebInspector.ServiceWorkerCacheView.prototype = {
WebInspector.SWCacheDataGridNode = function(data)
{
WebInspector.DataGridNode.call(this, data, false);
- this.selectable = false;
+ this.selectable = true;
}
WebInspector.SWCacheDataGridNode.prototype = {
@@ -189,17 +197,9 @@ WebInspector.SWCacheDataGridNode.prototype = {
_formatValue: function(cell, value)
{
- var valueElement = WebInspector.ObjectPropertiesSection.createValueElement(value, false, cell);
- valueElement.classList.add("source-code");
- if (value.type === "object") {
- var section = new WebInspector.ObjectPropertiesSection(value, valueElement);
- section.editable = false;
- section.skipProto();
- cell.appendChild(section.element);
- } else {
- valueElement.classList.add("primitive-value");
- cell.appendChild(valueElement);
- }
+ cell.classList.add("source-code");
+ cell.classList.add("primitive-value");
+ cell.appendChild(createTextNode(value));
},
__proto__: WebInspector.DataGridNode.prototype

Powered by Google App Engine
This is Rietveld 408576698