OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 queryViews[i].removeEventListener( | 226 queryViews[i].removeEventListener( |
227 Resources.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabase
Tables, this); | 227 Resources.DatabaseQueryView.Events.SchemaUpdated, this._updateDatabase
Tables, this); |
228 } | 228 } |
229 this._databaseTableViews.clear(); | 229 this._databaseTableViews.clear(); |
230 this._databaseQueryViews.clear(); | 230 this._databaseQueryViews.clear(); |
231 this._databaseTreeElements.clear(); | 231 this._databaseTreeElements.clear(); |
232 this.databasesListTreeElement.removeChildren(); | 232 this.databasesListTreeElement.removeChildren(); |
233 this.databasesListTreeElement.setExpandable(false); | 233 this.databasesListTreeElement.setExpandable(false); |
234 } | 234 } |
235 | 235 |
236 _resetDOMStorage() { | |
237 this._domStorageTreeElements.clear(); | |
238 this.localStorageListTreeElement.removeChildren(); | |
239 this.sessionStorageListTreeElement.removeChildren(); | |
240 } | |
241 | |
242 _resetCookies() { | |
243 this.cookieListTreeElement.removeChildren(); | |
244 } | |
245 | |
246 _resetCacheStorage() { | |
247 this.cacheStorageListTreeElement.removeChildren(); | |
248 this.cacheStorageListTreeElement.setExpandable(false); | |
249 } | |
250 | |
251 _resetAppCache() { | 236 _resetAppCache() { |
252 for (var frameId of Object.keys(this._applicationCacheFrameElements)) | 237 for (var frameId of Object.keys(this._applicationCacheFrameElements)) |
253 this._applicationCacheFrameManifestRemoved({data: frameId}); | 238 this._applicationCacheFrameManifestRemoved({data: frameId}); |
254 this.applicationCacheListTreeElement.setExpandable(false); | 239 this.applicationCacheListTreeElement.setExpandable(false); |
255 } | 240 } |
256 | 241 |
257 _reset() { | 242 _reset() { |
258 this._domains = {}; | 243 this._domains = {}; |
259 this._resetWebSQL(); | 244 this._resetWebSQL(); |
260 this._resetDOMStorage(); | 245 this.cookieListTreeElement.removeChildren(); |
261 this._resetCookies(); | |
262 this._resetCacheStorage(); | |
263 // No need to this._resetAppCache. | |
264 | |
265 this._panel.resetView(); | |
266 | |
267 if (this._sidebarTree.selectedTreeElement) | |
268 this._sidebarTree.selectedTreeElement.deselect(); | |
269 } | 246 } |
270 | 247 |
271 _frameNavigated(event) { | 248 _frameNavigated(event) { |
272 var frame = event.data; | 249 var frame = event.data; |
273 | 250 |
274 if (!frame.parentFrame) | 251 if (!frame.parentFrame) |
275 this._reset(); | 252 this._reset(); |
276 | 253 |
277 var applicationCacheFrameTreeElement = this._applicationCacheFrameElements[f
rame.id]; | 254 var applicationCacheFrameTreeElement = this._applicationCacheFrameElements[f
rame.id]; |
278 if (applicationCacheFrameTreeElement) | 255 if (applicationCacheFrameTreeElement) |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca
che); | 829 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca
che); |
853 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model); | 830 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model); |
854 | 831 |
855 var swCacheTreeElement = this._cacheTreeElement(model, cache); | 832 var swCacheTreeElement = this._cacheTreeElement(model, cache); |
856 if (!swCacheTreeElement) | 833 if (!swCacheTreeElement) |
857 return; | 834 return; |
858 | 835 |
859 swCacheTreeElement.clear(); | 836 swCacheTreeElement.clear(); |
860 this.removeChild(swCacheTreeElement); | 837 this.removeChild(swCacheTreeElement); |
861 this._swCacheTreeElements.remove(swCacheTreeElement); | 838 this._swCacheTreeElements.remove(swCacheTreeElement); |
| 839 this.setExpandable(this.childCount() > 0); |
862 } | 840 } |
863 | 841 |
864 /** | 842 /** |
865 * @param {!SDK.ServiceWorkerCacheModel} model | 843 * @param {!SDK.ServiceWorkerCacheModel} model |
866 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache | 844 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache |
867 * @return {?Resources.SWCacheTreeElement} | 845 * @return {?Resources.SWCacheTreeElement} |
868 */ | 846 */ |
869 _cacheTreeElement(model, cache) { | 847 _cacheTreeElement(model, cache) { |
870 var index = -1; | 848 var index = -1; |
871 for (var i = 0; i < this._swCacheTreeElements.length; ++i) { | 849 for (var i = 0; i < this._swCacheTreeElements.length; ++i) { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.
data.databaseId); | 1101 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event.
data.databaseId); |
1124 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); | 1102 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); |
1125 | 1103 |
1126 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId)
; | 1104 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId)
; |
1127 if (!idbDatabaseTreeElement) | 1105 if (!idbDatabaseTreeElement) |
1128 return; | 1106 return; |
1129 | 1107 |
1130 idbDatabaseTreeElement.clear(); | 1108 idbDatabaseTreeElement.clear(); |
1131 this.removeChild(idbDatabaseTreeElement); | 1109 this.removeChild(idbDatabaseTreeElement); |
1132 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement); | 1110 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement); |
| 1111 this.setExpandable(this.childCount() > 0); |
1133 } | 1112 } |
1134 | 1113 |
1135 /** | 1114 /** |
1136 * @param {!Common.Event} event | 1115 * @param {!Common.Event} event |
1137 */ | 1116 */ |
1138 _indexedDBLoaded(event) { | 1117 _indexedDBLoaded(event) { |
1139 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data
.database); | 1118 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data
.database); |
1140 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); | 1119 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); |
1141 | 1120 |
1142 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da
tabaseId); | 1121 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da
tabaseId); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 | 1626 |
1648 this.element.classList.add('storage-view'); | 1627 this.element.classList.add('storage-view'); |
1649 this._emptyWidget = new UI.EmptyWidget(''); | 1628 this._emptyWidget = new UI.EmptyWidget(''); |
1650 this._emptyWidget.show(this.element); | 1629 this._emptyWidget.show(this.element); |
1651 } | 1630 } |
1652 | 1631 |
1653 setText(text) { | 1632 setText(text) { |
1654 this._emptyWidget.text = text; | 1633 this._emptyWidget.text = text; |
1655 } | 1634 } |
1656 }; | 1635 }; |
OLD | NEW |