| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @implements {SDK.TargetManager.Observer} | 5 * @implements {SDK.TargetManager.Observer} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Resources.ClearStorageView = class extends UI.VBox { | 8 Resources.ClearStorageView = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(true); | 10 super(true); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 this._reportView.setSubtitle(this._securityOrigin); | 95 this._reportView.setSubtitle(this._securityOrigin); |
| 96 } | 96 } |
| 97 | 97 |
| 98 _clear() { | 98 _clear() { |
| 99 var storageTypes = []; | 99 var storageTypes = []; |
| 100 for (var type of this._settings.keys()) { | 100 for (var type of this._settings.keys()) { |
| 101 if (this._settings.get(type).get()) | 101 if (this._settings.get(type).get()) |
| 102 storageTypes.push(type); | 102 storageTypes.push(type); |
| 103 } | 103 } |
| 104 | 104 |
| 105 this._target.storageAgent().clearDataForOrigin(this._securityOrigin, storage
Types.join(',')); | 105 var securityOriginManager = this._target.model(SDK.SecurityOriginManager); |
| 106 securityOriginManager.clearDataForSecurityOrigin(this._securityOrigin, stora
geTypes.join(',')); |
| 106 | 107 |
| 107 var set = new Set(storageTypes); | 108 var set = new Set(storageTypes); |
| 108 var hasAll = set.has(Protocol.Storage.StorageType.All); | 109 var hasAll = set.has(Protocol.Storage.StorageType.All); |
| 109 if (set.has(Protocol.Storage.StorageType.Cookies) || hasAll) { | 110 if (set.has(Protocol.Storage.StorageType.Cookies) || hasAll) { |
| 110 var cookieModel = this._target.model(SDK.CookieModel); | 111 var cookieModel = this._target.model(SDK.CookieModel); |
| 111 if (cookieModel) | 112 if (cookieModel) |
| 112 cookieModel.clear(); | 113 cookieModel.clear(); |
| 113 } | 114 } |
| 114 | 115 |
| 115 if (set.has(Protocol.Storage.StorageType.Indexeddb) || hasAll) { | 116 if (set.has(Protocol.Storage.StorageType.Indexeddb) || hasAll) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 150 |
| 150 this._clearButton.disabled = true; | 151 this._clearButton.disabled = true; |
| 151 var label = this._clearButton.textContent; | 152 var label = this._clearButton.textContent; |
| 152 this._clearButton.textContent = Common.UIString('Clearing...'); | 153 this._clearButton.textContent = Common.UIString('Clearing...'); |
| 153 setTimeout(() => { | 154 setTimeout(() => { |
| 154 this._clearButton.disabled = false; | 155 this._clearButton.disabled = false; |
| 155 this._clearButton.textContent = label; | 156 this._clearButton.textContent = label; |
| 156 }, 500); | 157 }, 500); |
| 157 } | 158 } |
| 158 }; | 159 }; |
| OLD | NEW |