Chromium Code Reviews| 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() { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 if (this._visibleView) | 65 if (this._visibleView) |
| 66 this._visibleView.detach(); | 66 this._visibleView.detach(); |
| 67 | 67 |
| 68 this._visibleView = view; | 68 this._visibleView = view; |
| 69 | 69 |
| 70 if (view) | 70 if (view) |
| 71 this.splitWidget().setMainWidget(view); | 71 this.splitWidget().setMainWidget(view); |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 _onOriginSecurityChanged: function(event) { | |
|
pfeldman
2015/08/18 18:35:08
code style, annotations
| |
| 75 // This can't trigger unless the Security panel is open, so we're not sp amming the console unless the Security panel is enabled and opened for testing. | |
| 76 console.log(event.data); | |
|
dgozman
2015/08/18 18:41:49
Please don't commit console.log into production co
| |
| 77 }, | |
| 78 | |
| 74 /** | 79 /** |
| 75 * @override | 80 * @override |
| 76 * @param {!WebInspector.Target} target | 81 * @param {!WebInspector.Target} target |
| 77 */ | 82 */ |
| 78 targetAdded: function(target) | 83 targetAdded: function(target) |
| 79 { | 84 { |
| 80 if (!this._target) { | 85 if (!this._target) { |
| 81 this._target = target; | 86 this._target = target; |
| 82 this._securityModel = WebInspector.SecurityModel.fromTarget(target); | 87 this._securityModel = WebInspector.SecurityModel.fromTarget(target); |
| 83 this._securityModel.addEventListener(WebInspector.SecurityModel.Even tTypes.SecurityStateChanged, this._onSecurityStateChanged, this); | 88 this._securityModel.addEventListener(WebInspector.SecurityModel.Even tTypes.SecurityStateChanged, this._onSecurityStateChanged, this); |
| 89 this._securityModel.addEventListener(WebInspector.SecurityModel.Even tTypes.OriginSecurityChanged, this._onOriginSecurityChanged, this); | |
| 84 this._updateSecurityState(this._securityModel.securityState(), []); | 90 this._updateSecurityState(this._securityModel.securityState(), []); |
| 85 } | 91 } |
| 86 }, | 92 }, |
| 87 | 93 |
| 88 /** | 94 /** |
| 89 * @override | 95 * @override |
| 90 * @param {!WebInspector.Target} target | 96 * @param {!WebInspector.Target} target |
| 91 */ | 97 */ |
| 92 targetRemoved: function(target) | 98 targetRemoved: function(target) |
| 93 { | 99 { |
| 94 if (target === this._target) { | 100 if (target === this._target) { |
| 95 this._securityModel.removeEventListener(WebInspector.SecurityModel.E ventTypes.SecurityStateChanged, this._onSecurityStateChanged, this); | 101 this._securityModel.removeEventListener(WebInspector.SecurityModel.E ventTypes.SecurityStateChanged, this._onSecurityStateChanged, this); |
| 102 this._securityModel.removeEventListener(WebInspector.SecurityModel.E ventTypes.OriginSecurityChanged, this._onOriginSecurityChanged, this); | |
| 96 delete this._securityModel; | 103 delete this._securityModel; |
| 97 delete this._target; | 104 delete this._target; |
| 98 this._updateSecurityState(SecurityAgent.SecurityState.Unknown, []); | 105 this._updateSecurityState(SecurityAgent.SecurityState.Unknown, []); |
| 99 } | 106 } |
| 100 }, | 107 }, |
| 101 | 108 |
| 102 __proto__: WebInspector.PanelWithSidebar.prototype | 109 __proto__: WebInspector.PanelWithSidebar.prototype |
| 103 } | 110 } |
| 104 | 111 |
| 105 /** | 112 /** |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 this._lockIcon.classList.add("lock-icon-" + this._securityState); | 231 this._lockIcon.classList.add("lock-icon-" + this._securityState); |
| 225 this._securityStateText.textContent = WebInspector.UIString("Page securi ty state: %s", this._securityState); | 232 this._securityStateText.textContent = WebInspector.UIString("Page securi ty state: %s", this._securityState); |
| 226 | 233 |
| 227 this._securityExplanations.removeChildren(); | 234 this._securityExplanations.removeChildren(); |
| 228 for (var explanation of explanations) | 235 for (var explanation of explanations) |
| 229 this._addExplanation(explanation); | 236 this._addExplanation(explanation); |
| 230 }, | 237 }, |
| 231 | 238 |
| 232 __proto__: WebInspector.VBox.prototype | 239 __proto__: WebInspector.VBox.prototype |
| 233 } | 240 } |
| OLD | NEW |