Chromium Code Reviews| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 * @param {!WebInspector.ResourcesPanel} resourcesPanel | 9 * @param {!WebInspector.ResourcesPanel} resourcesPanel |
| 10 */ | 10 */ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @param {!WebInspector.Target} target | 66 * @param {!WebInspector.Target} target |
| 67 */ | 67 */ |
| 68 targetAdded: function(target) | 68 targetAdded: function(target) |
| 69 { | 69 { |
| 70 if (this._target) | 70 if (this._target) |
| 71 return; | 71 return; |
| 72 this._target = target; | 72 this._target = target; |
| 73 this._updateOrigin(target.resourceTreeModel.mainFrame ? target.resourceT reeModel.mainFrame.url : ""); | 73 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target ); |
| 74 this._updateOrigin((resourceTreeModel && resourceTreeModel.mainFrame) ? resourceTreeModel.mainFrame.url : ""); | |
|
dgozman
2016/07/22 03:27:02
We should use securityOriginManager.mainSecurityOr
eostroukhov-old
2016/07/22 23:27:43
Done.
| |
| 74 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E vents.MainFrameNavigated, this._updateFrame, this); | 75 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E vents.MainFrameNavigated, this._updateFrame, this); |
|
dgozman
2016/07/22 03:27:02
And listen to SecurityOriginChanged event.
eostroukhov-old
2016/07/22 23:27:43
Done.
| |
| 75 }, | 76 }, |
| 76 | 77 |
| 77 /** | 78 /** |
| 78 * @param {!WebInspector.Event} event | 79 * @param {!WebInspector.Event} event |
| 79 */ | 80 */ |
| 80 _updateFrame: function(event) | 81 _updateFrame: function(event) |
| 81 { | 82 { |
| 82 var frame = /** *@type {!WebInspector.ResourceTreeFrame} */ (event.data) ; | 83 var frame = /** *@type {!WebInspector.ResourceTreeFrame} */ (event.data) ; |
| 83 this._updateOrigin(frame.url); | 84 this._updateOrigin(frame.url); |
| 84 }, | 85 }, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 if (set.has(StorageAgent.StorageType.Websql) || hasAll) { | 125 if (set.has(StorageAgent.StorageType.Websql) || hasAll) { |
| 125 var databaseModel = WebInspector.DatabaseModel.fromTarget(this._targ et); | 126 var databaseModel = WebInspector.DatabaseModel.fromTarget(this._targ et); |
| 126 if (databaseModel) { | 127 if (databaseModel) { |
| 127 databaseModel.disable(); | 128 databaseModel.disable(); |
| 128 databaseModel.enable(); | 129 databaseModel.enable(); |
| 129 } | 130 } |
| 130 } | 131 } |
| 131 | 132 |
| 132 if (set.has(StorageAgent.StorageType.Cache_storage) || hasAll) { | 133 if (set.has(StorageAgent.StorageType.Cache_storage) || hasAll) { |
| 133 var target = WebInspector.targetManager.mainTarget(); | 134 var target = WebInspector.targetManager.mainTarget(); |
| 134 if (target) { | 135 var model = target && WebInspector.ServiceWorkerCacheModel.fromTarge t(target); |
| 135 var model = WebInspector.ServiceWorkerCacheModel.fromTarget(targ et); | 136 if (model) |
| 136 if (model) | 137 model.clearForOrigin(this._securityOrigin); |
| 137 model.clearForOrigin(this._securityOrigin); | |
| 138 } | |
| 139 } | 138 } |
| 140 | 139 |
| 141 if (set.has(StorageAgent.StorageType.Appcache) || hasAll) { | 140 if (set.has(StorageAgent.StorageType.Appcache) || hasAll) { |
| 142 var appcacheModel = WebInspector.ApplicationCacheModel.fromTarget(th is._target); | 141 var appcacheModel = WebInspector.ApplicationCacheModel.fromTarget(th is._target); |
| 143 if (appcacheModel) | 142 if (appcacheModel) |
| 144 appcacheModel.reset(); | 143 appcacheModel.reset(); |
| 145 } | 144 } |
| 146 | 145 |
| 147 this._clearButton.disabled = true; | 146 this._clearButton.disabled = true; |
| 148 this._clearButton.textContent = WebInspector.UIString("Clearing..."); | 147 this._clearButton.textContent = WebInspector.UIString("Clearing..."); |
| 149 setTimeout(() => { | 148 setTimeout(() => { |
| 150 this._clearButton.disabled = false; | 149 this._clearButton.disabled = false; |
| 151 this._clearButton.textContent = WebInspector.UIString("Clear selecte d"); | 150 this._clearButton.textContent = WebInspector.UIString("Clear selecte d"); |
| 152 }, 500); | 151 }, 500); |
| 153 }, | 152 }, |
| 154 | 153 |
| 155 /** | 154 /** |
| 156 * @override | 155 * @override |
| 157 * @param {!WebInspector.Target} target | 156 * @param {!WebInspector.Target} target |
| 158 */ | 157 */ |
| 159 targetRemoved: function(target) | 158 targetRemoved: function(target) |
| 160 { | 159 { |
| 161 }, | 160 }, |
| 162 | 161 |
| 163 __proto__: WebInspector.VBox.prototype | 162 __proto__: WebInspector.VBox.prototype |
| 164 } | 163 } |
| OLD | NEW |