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 |