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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 treeElement.revealAndSelect(true); | 210 treeElement.revealAndSelect(true); |
211 return; | 211 return; |
212 } | 212 } |
213 } | 213 } |
214 } | 214 } |
215 this._manifestTreeElement.select(); | 215 this._manifestTreeElement.select(); |
216 } | 216 } |
217 | 217 |
218 _resetWithFrames() { | 218 _resetWithFrames() { |
219 this._resourcesSection.reset(); | 219 this._resourcesSection.reset(); |
220 this._reset(); | 220 this._resetCookies(); |
dgozman
2017/04/06 00:12:23
No more _resetWebSQL?
eostroukhov
2017/04/06 00:26:18
Done. Thanks for catching this!
| |
221 } | 221 } |
222 | 222 |
223 _resetWebSQL() { | 223 _resetWebSQL() { |
224 var queryViews = this._databaseQueryViews.valuesArray(); | 224 var queryViews = this._databaseQueryViews.valuesArray(); |
225 for (var i = 0; i < queryViews.length; ++i) { | 225 for (var i = 0; i < queryViews.length; ++i) { |
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() { | 236 _resetCookies() { |
237 this._domains = {}; | |
243 this.cookieListTreeElement.removeChildren(); | 238 this.cookieListTreeElement.removeChildren(); |
244 } | 239 } |
245 | 240 |
246 _resetCacheStorage() { | |
247 this.cacheStorageListTreeElement.removeChildren(); | |
248 this.cacheStorageListTreeElement.setExpandable(false); | |
249 } | |
250 | |
251 _resetAppCache() { | 241 _resetAppCache() { |
252 for (var frameId of Object.keys(this._applicationCacheFrameElements)) | 242 for (var frameId of Object.keys(this._applicationCacheFrameElements)) |
253 this._applicationCacheFrameManifestRemoved({data: frameId}); | 243 this._applicationCacheFrameManifestRemoved({data: frameId}); |
254 this.applicationCacheListTreeElement.setExpandable(false); | 244 this.applicationCacheListTreeElement.setExpandable(false); |
255 } | 245 } |
256 | 246 |
257 _reset() { | |
258 this._domains = {}; | |
259 this._resetWebSQL(); | |
260 this._resetDOMStorage(); | |
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 } | |
270 | |
271 _frameNavigated(event) { | 247 _frameNavigated(event) { |
272 var frame = event.data; | 248 var frame = event.data; |
273 | 249 |
274 if (!frame.parentFrame) | 250 if (!frame.parentFrame) |
275 this._reset(); | 251 this._resetCookies(); |
dgozman
2017/04/06 00:12:23
No more _resetWebSQL?
eostroukhov
2017/04/06 00:26:18
Done.
| |
276 | 252 |
277 var applicationCacheFrameTreeElement = this._applicationCacheFrameElements[f rame.id]; | 253 var applicationCacheFrameTreeElement = this._applicationCacheFrameElements[f rame.id]; |
278 if (applicationCacheFrameTreeElement) | 254 if (applicationCacheFrameTreeElement) |
279 applicationCacheFrameTreeElement.frameNavigated(frame); | 255 applicationCacheFrameTreeElement.frameNavigated(frame); |
280 this._addCookieDocument(frame); | 256 this._addCookieDocument(frame); |
281 } | 257 } |
282 | 258 |
283 /** | 259 /** |
284 * @param {!Common.Event} event | 260 * @param {!Common.Event} event |
285 */ | 261 */ |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
852 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca che); | 828 var cache = /** @type {!SDK.ServiceWorkerCacheModel.Cache} */ (event.data.ca che); |
853 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model); | 829 var model = /** @type {!SDK.ServiceWorkerCacheModel} */ (event.data.model); |
854 | 830 |
855 var swCacheTreeElement = this._cacheTreeElement(model, cache); | 831 var swCacheTreeElement = this._cacheTreeElement(model, cache); |
856 if (!swCacheTreeElement) | 832 if (!swCacheTreeElement) |
857 return; | 833 return; |
858 | 834 |
859 swCacheTreeElement.clear(); | 835 swCacheTreeElement.clear(); |
860 this.removeChild(swCacheTreeElement); | 836 this.removeChild(swCacheTreeElement); |
861 this._swCacheTreeElements.remove(swCacheTreeElement); | 837 this._swCacheTreeElements.remove(swCacheTreeElement); |
838 this.setExpandable(this.childCount() > 0); | |
862 } | 839 } |
863 | 840 |
864 /** | 841 /** |
865 * @param {!SDK.ServiceWorkerCacheModel} model | 842 * @param {!SDK.ServiceWorkerCacheModel} model |
866 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache | 843 * @param {!SDK.ServiceWorkerCacheModel.Cache} cache |
867 * @return {?Resources.SWCacheTreeElement} | 844 * @return {?Resources.SWCacheTreeElement} |
868 */ | 845 */ |
869 _cacheTreeElement(model, cache) { | 846 _cacheTreeElement(model, cache) { |
870 var index = -1; | 847 var index = -1; |
871 for (var i = 0; i < this._swCacheTreeElements.length; ++i) { | 848 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); | 1100 var databaseId = /** @type {!Resources.IndexedDBModel.DatabaseId} */ (event. data.databaseId); |
1124 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); | 1101 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); |
1125 | 1102 |
1126 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId) ; | 1103 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, databaseId) ; |
1127 if (!idbDatabaseTreeElement) | 1104 if (!idbDatabaseTreeElement) |
1128 return; | 1105 return; |
1129 | 1106 |
1130 idbDatabaseTreeElement.clear(); | 1107 idbDatabaseTreeElement.clear(); |
1131 this.removeChild(idbDatabaseTreeElement); | 1108 this.removeChild(idbDatabaseTreeElement); |
1132 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement); | 1109 this._idbDatabaseTreeElements.remove(idbDatabaseTreeElement); |
1110 this.setExpandable(this.childCount() > 0); | |
1133 } | 1111 } |
1134 | 1112 |
1135 /** | 1113 /** |
1136 * @param {!Common.Event} event | 1114 * @param {!Common.Event} event |
1137 */ | 1115 */ |
1138 _indexedDBLoaded(event) { | 1116 _indexedDBLoaded(event) { |
1139 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data .database); | 1117 var database = /** @type {!Resources.IndexedDBModel.Database} */ (event.data .database); |
1140 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); | 1118 var model = /** @type {!Resources.IndexedDBModel} */ (event.data.model); |
1141 | 1119 |
1142 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da tabaseId); | 1120 var idbDatabaseTreeElement = this._idbDatabaseTreeElement(model, database.da tabaseId); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1647 | 1625 |
1648 this.element.classList.add('storage-view'); | 1626 this.element.classList.add('storage-view'); |
1649 this._emptyWidget = new UI.EmptyWidget(''); | 1627 this._emptyWidget = new UI.EmptyWidget(''); |
1650 this._emptyWidget.show(this.element); | 1628 this._emptyWidget.show(this.element); |
1651 } | 1629 } |
1652 | 1630 |
1653 setText(text) { | 1631 setText(text) { |
1654 this._emptyWidget.text = text; | 1632 this._emptyWidget.text = text; |
1655 } | 1633 } |
1656 }; | 1634 }; |
OLD | NEW |