Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js b/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js |
| index e038177e518b3a1453e0ad953d7f13d1b387123a..aed6f2b1f745b7c2d09c6e0f6358f9637517143a 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/resources/ClearStorageView.js |
| @@ -42,7 +42,7 @@ WebInspector.ClearStorageView = function(resourcesPanel) |
| this._appendItem(caches, WebInspector.UIString("Cache storage"), "cache_storage"); |
| this._appendItem(caches, WebInspector.UIString("Application cache"), "appcache"); |
| - WebInspector.targetManager.observeTargets(this); |
| + WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.DOM); |
|
dgozman
2016/07/22 23:44:22
ClearStorageView is not about DOM.
eostroukhov-old
2016/07/25 18:16:58
Done.
|
| var footer = this._reportView.appendSection("", "clear-storage-button").appendRow(); |
| this._clearButton = createTextButton(WebInspector.UIString("Clear site data"), this._clear.bind(this), WebInspector.UIString("Clear site data")); |
| footer.appendChild(this._clearButton); |
| @@ -70,8 +70,9 @@ WebInspector.ClearStorageView.prototype = { |
| if (this._target) |
| return; |
| this._target = target; |
| - this._updateOrigin(target.resourceTreeModel.mainFrame ? target.resourceTreeModel.mainFrame.url : ""); |
| - WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._updateFrame, this); |
| + var SecurityOriginManager = WebInspector.SecurityOriginManager.fromTarget(target); |
|
dgozman
2016/07/22 23:44:22
style: lowercase first character.
eostroukhov-old
2016/07/25 18:16:58
Done.
|
| + this._updateOrigin(SecurityOriginManager.mainSecurityOrigin()); |
| + SecurityOriginManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._updateFrame, this); |
|
dgozman
2016/07/22 23:44:22
There is no such event. And maybe no test for this
eostroukhov-old
2016/07/25 18:16:58
Done.
|
| }, |
| /** |
| @@ -79,8 +80,8 @@ WebInspector.ClearStorageView.prototype = { |
| */ |
| _updateFrame: function(event) |
|
dgozman
2016/07/22 23:44:22
Rename the method.
eostroukhov-old
2016/07/25 18:16:58
Done.
|
| { |
| - var frame = /** *@type {!WebInspector.ResourceTreeFrame} */ (event.data); |
| - this._updateOrigin(frame.url); |
| + var origin = /** *@type {string} */ (event.data); |
| + this._updateOrigin(origin); |
| }, |
| /** |
| @@ -131,11 +132,9 @@ WebInspector.ClearStorageView.prototype = { |
| if (set.has(StorageAgent.StorageType.Cache_storage) || hasAll) { |
| var target = WebInspector.targetManager.mainTarget(); |
| - if (target) { |
| - var model = WebInspector.ServiceWorkerCacheModel.fromTarget(target); |
| - if (model) |
| - model.clearForOrigin(this._securityOrigin); |
| - } |
| + var model = target && WebInspector.ServiceWorkerCacheModel.fromTarget(target); |
| + if (model) |
| + model.clearForOrigin(this._securityOrigin); |
| } |
| if (set.has(StorageAgent.StorageType.Appcache) || hasAll) { |