Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js

Issue 2137773002: [DevTools] Replace the target type with capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
index a2bf52c74b0b8357864721f41585b80b55e176a8..8205e9df884412ff521d23fc2973ff8c51b3fad9 100644
--- a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js
@@ -27,7 +27,7 @@ WebInspector.SecurityPanel = function()
/** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, number>} */
this._filterRequestCounts = new Map();
- WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Page);
+ WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capability.Network);
}
/** @typedef {string} */
@@ -248,12 +248,12 @@ WebInspector.SecurityPanel.prototype = {
this._target = target;
- target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
+ if (target.hasBrowserCapability())
+ target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
+
var networkManager = WebInspector.NetworkManager.fromTarget(target);
- if (networkManager) {
- networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResponseReceived, this._onResponseReceived, this);
- networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestFinished, this);
- }
+ networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResponseReceived, this._onResponseReceived, this);
+ networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestFinished, this);
var securityModel = WebInspector.SecurityModel.fromTarget(target);
securityModel.addEventListener(WebInspector.SecurityModel.EventTypes.SecurityStateChanged, this._onSecurityStateChanged, this);

Powered by Google App Engine
This is Rietveld 408576698