| 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.SDKModel} | 7 * @extends {WebInspector.SDKModel} |
| 8 * @param {!WebInspector.Target} target | 8 * @param {!WebInspector.Target} target |
| 9 */ | 9 */ |
| 10 WebInspector.SecurityModel = function(target) | 10 WebInspector.SecurityModel = function(target) |
| 11 { | 11 { |
| 12 WebInspector.SDKModel.call(this, WebInspector.SecurityModel, target); | 12 WebInspector.SDKModel.call(this, WebInspector.SecurityModel, target); |
| 13 this._dispatcher = new WebInspector.SecurityDispatcher(this); | 13 this._dispatcher = new WebInspector.SecurityDispatcher(this); |
| 14 this._securityAgent = target.securityAgent(); | 14 this._securityAgent = target.securityAgent(); |
| 15 target.registerSecurityDispatcher(this._dispatcher); | 15 target.registerSecurityDispatcher(this._dispatcher); |
| 16 this._securityAgent.enable(); | 16 this._securityAgent.enable(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 /** @enum {symbol} */ | 19 /** @enum {symbol} */ |
| 20 WebInspector.SecurityModel.Events = { | 20 WebInspector.SecurityModel.Events = { |
| 21 SecurityStateChanged: Symbol("SecurityStateChanged") | 21 SecurityStateChanged: Symbol("SecurityStateChanged") |
| 22 } | 22 } |
| 23 | 23 |
| 24 WebInspector.SecurityModel.prototype = { | 24 WebInspector.SecurityModel.prototype = { |
| 25 __proto__: WebInspector.SDKModel.prototype | 25 __proto__: WebInspector.SDKModel.prototype, |
| 26 |
| 27 showCertificateViewer: function(certificateId) |
| 28 { |
| 29 this._securityAgent.showCertificateViewer(certificateId); |
| 30 } |
| 26 } | 31 } |
| 27 | 32 |
| 28 /** | 33 /** |
| 29 * @param {!WebInspector.Target} target | 34 * @param {!WebInspector.Target} target |
| 30 * @return {?WebInspector.SecurityModel} | 35 * @return {?WebInspector.SecurityModel} |
| 31 */ | 36 */ |
| 32 WebInspector.SecurityModel.fromTarget = function(target) | 37 WebInspector.SecurityModel.fromTarget = function(target) |
| 33 { | 38 { |
| 34 var model = /** @type {?WebInspector.SecurityModel} */ (target.model(WebInsp
ector.SecurityModel)); | 39 var model = /** @type {?WebInspector.SecurityModel} */ (target.model(WebInsp
ector.SecurityModel)); |
| 35 if (!model) | 40 if (!model) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations | 104 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations |
| 100 * @param {!SecurityAgent.InsecureContentStatus=} insecureContentStatus | 105 * @param {!SecurityAgent.InsecureContentStatus=} insecureContentStatus |
| 101 * @param {boolean=} schemeIsCryptographic | 106 * @param {boolean=} schemeIsCryptographic |
| 102 */ | 107 */ |
| 103 securityStateChanged: function(securityState, explanations, insecureContentS
tatus, schemeIsCryptographic) | 108 securityStateChanged: function(securityState, explanations, insecureContentS
tatus, schemeIsCryptographic) |
| 104 { | 109 { |
| 105 var pageSecurityState = new WebInspector.PageSecurityState(securityState
, explanations || [], insecureContentStatus || null, schemeIsCryptographic || fa
lse); | 110 var pageSecurityState = new WebInspector.PageSecurityState(securityState
, explanations || [], insecureContentStatus || null, schemeIsCryptographic || fa
lse); |
| 106 this._model.dispatchEventToListeners(WebInspector.SecurityModel.Events.S
ecurityStateChanged, pageSecurityState); | 111 this._model.dispatchEventToListeners(WebInspector.SecurityModel.Events.S
ecurityStateChanged, pageSecurityState); |
| 107 } | 112 } |
| 108 } | 113 } |
| OLD | NEW |