| OLD | NEW |
| 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); | |
| 20 | 19 |
| 21 /** @type {!Map<!NetworkAgent.LoaderId, !WebInspector.NetworkRequest>} */ | 20 /** @type {!Map<!NetworkAgent.LoaderId, !WebInspector.NetworkRequest>} */ |
| 22 this._lastResponseReceivedForLoaderId = new Map(); | 21 this._lastResponseReceivedForLoaderId = new Map(); |
| 23 | 22 |
| 24 /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPa
nel.OriginState>} */ | 23 /** @type {!Map<!WebInspector.SecurityPanel.Origin, !WebInspector.SecurityPa
nel.OriginState>} */ |
| 25 this._origins = new Map(); | 24 this._origins = new Map(); |
| 26 | 25 |
| 27 /** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, numbe
r>} */ | 26 /** @type {!Map<!WebInspector.NetworkLogView.MixedContentFilterValues, numbe
r>} */ |
| 28 this._filterRequestCounts = new Map(); | 27 this._filterRequestCounts = new Map(); |
| 29 | 28 |
| 30 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili
ty.Network); | 29 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Capabili
ty.Network); |
| 31 } | 30 } |
| 32 | 31 |
| 33 /** @typedef {string} */ | 32 /** @typedef {string} */ |
| 34 WebInspector.SecurityPanel.Origin; | 33 WebInspector.SecurityPanel.Origin; |
| 35 | 34 |
| 36 /** | 35 /** |
| 37 * @typedef {Object} | 36 * @typedef {Object} |
| 38 * @property {!SecurityAgent.SecurityState} securityState - Current security sta
te of the origin. | 37 * @property {!SecurityAgent.SecurityState} securityState - Current security sta
te of the origin. |
| 39 * @property {?NetworkAgent.SecurityDetails} securityDetails - Security details
of the origin, if available. | 38 * @property {?NetworkAgent.SecurityDetails} securityDetails - Security details
of the origin, if available. |
| 40 * @property {?Promise<>} certificateDetailsPromise - Certificate details of the
origin. | 39 * @property {?Promise<>} certificateDetailsPromise - Certificate details of the
origin. |
| 41 * @property {?WebInspector.SecurityOriginView} originView - Current SecurityOri
ginView corresponding to origin. | 40 * @property {?WebInspector.SecurityOriginView} originView - Current SecurityOri
ginView corresponding to origin. |
| 42 */ | 41 */ |
| 43 WebInspector.SecurityPanel.OriginState; | 42 WebInspector.SecurityPanel.OriginState; |
| 44 | 43 |
| 45 WebInspector.SecurityPanel.prototype = { | 44 WebInspector.SecurityPanel.prototype = { |
| 46 | |
| 47 /** | 45 /** |
| 48 * @param {!SecurityAgent.SecurityState} securityState | 46 * @param {!SecurityAgent.SecurityState} securityState |
| 49 */ | 47 */ |
| 50 setRanInsecureContentStyle: function(securityState) | 48 setRanInsecureContentStyle: function(securityState) |
| 51 { | 49 { |
| 52 this._ranInsecureContentStyle = securityState; | 50 this._ranInsecureContentStyle = securityState; |
| 53 }, | 51 }, |
| 54 | 52 |
| 55 /** | 53 /** |
| 56 * @param {!SecurityAgent.SecurityState} securityState | 54 * @param {!SecurityAgent.SecurityState} securityState |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 }, | 101 }, |
| 104 | 102 |
| 105 wasShown: function() | 103 wasShown: function() |
| 106 { | 104 { |
| 107 WebInspector.Panel.prototype.wasShown.call(this); | 105 WebInspector.Panel.prototype.wasShown.call(this); |
| 108 if (!this._visibleView) | 106 if (!this._visibleView) |
| 109 this.selectAndSwitchToMainView(); | 107 this.selectAndSwitchToMainView(); |
| 110 }, | 108 }, |
| 111 | 109 |
| 112 /** | 110 /** |
| 111 * @override |
| 112 */ |
| 113 focus: function() |
| 114 { |
| 115 this._sidebarTree.focus(); |
| 116 }, |
| 117 |
| 118 /** |
| 113 * @param {!WebInspector.VBox} view | 119 * @param {!WebInspector.VBox} view |
| 114 */ | 120 */ |
| 115 _setVisibleView: function(view) | 121 _setVisibleView: function(view) |
| 116 { | 122 { |
| 117 if (this._visibleView === view) | 123 if (this._visibleView === view) |
| 118 return; | 124 return; |
| 119 | 125 |
| 120 if (this._visibleView) | 126 if (this._visibleView) |
| 121 this._visibleView.detach(); | 127 this._visibleView.detach(); |
| 122 | 128 |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 row.createChild("div").textContent = key; | 1041 row.createChild("div").textContent = key; |
| 1036 | 1042 |
| 1037 var valueDiv = row.createChild("div"); | 1043 var valueDiv = row.createChild("div"); |
| 1038 if (typeof value === "string") { | 1044 if (typeof value === "string") { |
| 1039 valueDiv.textContent = value; | 1045 valueDiv.textContent = value; |
| 1040 } else { | 1046 } else { |
| 1041 valueDiv.appendChild(value); | 1047 valueDiv.appendChild(value); |
| 1042 } | 1048 } |
| 1043 } | 1049 } |
| 1044 } | 1050 } |
| OLD | NEW |