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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js

Issue 2632553002: [DevTools] Clear local storage (Closed)
Patch Set: Created 3 years, 11 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/resources/DOMStorageItemsView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js
index 50df5868440198aabc710fe95b53b7d9ff200925..e4bae7cde2d797029b5cc34d1689a4cbb8722ca4 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/DOMStorageItemsView.js
@@ -39,6 +39,9 @@ Resources.DOMStorageItemsView = class extends UI.SimpleView {
this.deleteButton.setVisible(false);
this.deleteButton.addEventListener(UI.ToolbarButton.Events.Click, this._deleteButtonClicked, this);
+ this.clearButton = new UI.ToolbarButton(Common.UIString('Clear All'), 'largeicon-clear');
pfeldman 2017/01/13 18:51:25 this._clearButton - it should be private. While yo
eostroukhov 2017/01/19 00:42:10 Done.
+ this.clearButton.addEventListener(UI.ToolbarButton.Events.Click, this.clear, this);
+
this.refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh');
this.refreshButton.addEventListener(UI.ToolbarButton.Events.Click, this._refreshButtonClicked, this);
@@ -56,7 +59,10 @@ Resources.DOMStorageItemsView = class extends UI.SimpleView {
* @return {!Array.<!UI.ToolbarItem>}
*/
syncToolbarItems() {
- return [this.refreshButton, this.deleteButton];
+ if (this.domStorage.isLocalStorage)
+ return [this.refreshButton, this.clearButton, this.deleteButton];
pfeldman 2017/01/13 18:51:25 We are consistently using delete button to close t
eostroukhov 2017/01/19 00:42:10 Acknowledged (no change for now, pending new icons
+ else
+ return [this.refreshButton, this.deleteButton];
}
/**
@@ -252,4 +258,8 @@ Resources.DOMStorageItemsView = class extends UI.SimpleView {
if (this.domStorage)
this.domStorage.removeItem(node.data.key);
}
+
+ clear() {
pfeldman 2017/01/13 18:51:25 inline this.
eostroukhov 2017/01/19 00:42:10 Done.
+ this.domStorage.clear();
+ }
};

Powered by Google App Engine
This is Rietveld 408576698