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

Side by Side 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: [DevTools] Replace target type with capabilities 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.PanelWithSidebar} 7 * @extends {WebInspector.PanelWithSidebar}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.SecurityPanel = function() 10 WebInspector.SecurityPanel = function()
11 { 11 {
12 WebInspector.PanelWithSidebar.call(this, "security"); 12 WebInspector.PanelWithSidebar.call(this, "security");
13 13
14 this._mainView = new WebInspector.SecurityMainView(this); 14 this._mainView = new WebInspector.SecurityMainView(this);
15 15
16 this._sidebarMainViewElement = new WebInspector.SecurityPanelSidebarTreeElem ent(WebInspector.UIString("Overview"), this._setVisibleView.bind(this, this._mai nView), "security-main-view-sidebar-tree-item", "lock-icon"); 16 this._sidebarMainViewElement = new WebInspector.SecurityPanelSidebarTreeElem ent(WebInspector.UIString("Overview"), this._setVisibleView.bind(this, this._mai nView), "security-main-view-sidebar-tree-item", "lock-icon");
17 this._sidebarTree = new WebInspector.SecurityPanelSidebarTree(this._sidebarM ainViewElement, this.showOrigin.bind(this)); 17 this._sidebarTree = new WebInspector.SecurityPanelSidebarTree(this._sidebarM ainViewElement, this.showOrigin.bind(this));
18 this.panelSidebarElement().appendChild(this._sidebarTree.element); 18 this.panelSidebarElement().appendChild(this._sidebarTree.element);
19 this.setDefaultFocusedElement(this._sidebarTree.contentElement); 19 this.setDefaultFocusedElement(this._sidebarTree.contentElement);
20 20
21 /** @type {!Map<!NetworkAgent.LoaderId, !WebInspector.NetworkRequest>} */ 21 /** @type {!Map<!NetworkAgent.LoaderId, !WebInspector.NetworkRequest>} */
22 this._lastResponseReceivedForLoaderId = new Map(); 22 this._lastResponseReceivedForLoaderId = new Map();
23 23
24 /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPa nel.OriginState>} */ 24 /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPa nel.OriginState>} */
25 this._origins = new Map(); 25 this._origins = new Map();
26 26
27 /** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, numbe r>} */ 27 /** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, numbe r>} */
28 this._filterRequestCounts = new Map(); 28 this._filterRequestCounts = new Map();
29 29
30 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 30 WebInspector.targetManager.observeTargets(this);
dgozman 2016/07/12 00:34:11 This one should observe network domains.
eostroukhov-old 2016/07/12 21:46:16 Done.
31 } 31 }
32 32
33 /** @typedef {string} */ 33 /** @typedef {string} */
34 WebInspector.SecurityPanel.Origin; 34 WebInspector.SecurityPanel.Origin;
35 35
36 /** 36 /**
37 * @typedef {Object} 37 * @typedef {Object}
38 * @property {!SecurityAgent.SecurityState} securityState - Current security sta te of the origin. 38 * @property {!SecurityAgent.SecurityState} securityState - Current security sta te of the origin.
39 * @property {?NetworkAgent.SecurityDetails} securityDetails - Security details of the origin, if available. 39 * @property {?NetworkAgent.SecurityDetails} securityDetails - Security details of the origin, if available.
40 * @property {?Promise<!NetworkAgent.CertificateDetails>} certificateDetailsProm ise - Certificate details of the origin. Only available if securityDetails are a vailable. 40 * @property {?Promise<!NetworkAgent.CertificateDetails>} certificateDetailsProm ise - Certificate details of the origin. Only available if securityDetails are a vailable.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 * @override 241 * @override
242 * @param {!WebInspector.Target} target 242 * @param {!WebInspector.Target} target
243 */ 243 */
244 targetAdded: function(target) 244 targetAdded: function(target)
245 { 245 {
246 if (this._target) 246 if (this._target)
247 return; 247 return;
248 248
249 this._target = target; 249 this._target = target;
250 250
251 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel .EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this); 251 if (target.hasBrowserDomains())
252 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeM odel.EventTypes.MainFrameNavigated, this._onMainFrameNavigated, this);
252 var networkManager = WebInspector.NetworkManager.fromTarget(target); 253 var networkManager = WebInspector.NetworkManager.fromTarget(target);
253 if (networkManager) { 254 if (networkManager) {
254 networkManager.addEventListener(WebInspector.NetworkManager.EventTyp es.ResponseReceived, this._onResponseReceived, this); 255 networkManager.addEventListener(WebInspector.NetworkManager.EventTyp es.ResponseReceived, this._onResponseReceived, this);
255 networkManager.addEventListener(WebInspector.NetworkManager.EventTyp es.RequestFinished, this._onRequestFinished, this); 256 networkManager.addEventListener(WebInspector.NetworkManager.EventTyp es.RequestFinished, this._onRequestFinished, this);
256 } 257 }
257 258
258 var securityModel = WebInspector.SecurityModel.fromTarget(target); 259 var securityModel = WebInspector.SecurityModel.fromTarget(target);
259 securityModel.addEventListener(WebInspector.SecurityModel.EventTypes.Sec urityStateChanged, this._onSecurityStateChanged, this); 260 securityModel.addEventListener(WebInspector.SecurityModel.EventTypes.Sec urityStateChanged, this._onSecurityStateChanged, this);
260 }, 261 },
261 262
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 row.createChild("div").textContent = key; 1004 row.createChild("div").textContent = key;
1004 1005
1005 var valueDiv = row.createChild("div"); 1006 var valueDiv = row.createChild("div");
1006 if (typeof value === "string") { 1007 if (typeof value === "string") {
1007 valueDiv.textContent = value; 1008 valueDiv.textContent = value;
1008 } else { 1009 } else {
1009 valueDiv.appendChild(value); 1010 valueDiv.appendChild(value);
1010 } 1011 }
1011 } 1012 }
1012 } 1013 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698