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

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

Issue 2916193003: [CacheStorage] [IndexedDB] [DevTools] Added refresh button to category view of cache storage and in… (Closed)
Patch Set: Switched to refresh section buttons Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/resources/resourcesSidebar.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
index 6b2d25e6b90ae567d4a9d0fc06bc222cf231818b..609002a4c0a969b9042cff3b6dba237cf83f14fd 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ApplicationPanelSidebar.js
@@ -57,6 +57,7 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
this._applicationTreeElement.appendChild(clearStorageTreeElement);
var storageTreeElement = this._addSidebarSection(Common.UIString('Storage'));
+ this._addRefreshSectionButton(storageTreeElement, this._refreshStorageSection.bind(this));
this.localStorageListTreeElement =
new Resources.StorageCategoryTreeElement(panel, Common.UIString('Local Storage'), 'LocalStorage');
var localStorageIcon = UI.Icon.create('mediumicon-table', 'resource-tree-item');
@@ -83,6 +84,7 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
storageTreeElement.appendChild(this.cookieListTreeElement);
var cacheTreeElement = this._addSidebarSection(Common.UIString('Cache'));
+ this._addRefreshSectionButton(cacheTreeElement, this._refreshCacheSection.bind(this));
this.cacheStorageListTreeElement = new Resources.ServiceWorkerCacheTreeElement(panel);
cacheTreeElement.appendChild(this.cacheStorageListTreeElement);
this.applicationCacheListTreeElement =
@@ -130,6 +132,32 @@ Resources.ApplicationPanelSidebar = class extends UI.VBox {
return treeElement;
}
+ /**
+ * @param {!UI.TreeElement} treeElement
+ * @param {function()} refresh
+ */
+ _addRefreshSectionButton(treeElement, refresh) {
+ var refreshIcon = UI.Icon.create('largeicon-refresh', 'sidebar-section-button');
+ refreshIcon.addEventListener('click', refresh, false);
+ treeElement.setTrailingIcons([refreshIcon]);
+ }
+
+ _refreshStorageSection() {
+ var visibleView = this._panel.visibleView;
+ if (visibleView instanceof Resources.DOMStorageItemsView || visibleView instanceof Resources.CookieItemsView) {
+ // Local Storage, Session Storage || Cookies
+ visibleView.refreshItems();
+ } else if (visibleView instanceof Resources.DatabaseTableView) {
+ // Web SQL
+ visibleView.update();
+ }
+ this.indexedDBListTreeElement.refreshIndexedDB();
+ }
+
+ _refreshCacheSection() {
+ this.cacheStorageListTreeElement._refreshCaches();
+ }
+
/**
* @override
* @param {!SDK.Target} target
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/resources/resourcesSidebar.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698