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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityModel.js

Issue 2296953004: Send certificates to devtools when it's open instead of using certId (Closed)
Patch Set: self review Created 4 years, 3 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.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 /**
28 * @param {!SecurityAgent.CertificateId} certificateId
29 */
30 showCertificateViewer: function(certificateId)
31 {
32 this._securityAgent.showCertificateViewer(certificateId);
33 }
26 } 34 }
27 35
28 /** 36 /**
29 * @param {!WebInspector.Target} target 37 * @param {!WebInspector.Target} target
30 * @return {?WebInspector.SecurityModel} 38 * @return {?WebInspector.SecurityModel}
31 */ 39 */
32 WebInspector.SecurityModel.fromTarget = function(target) 40 WebInspector.SecurityModel.fromTarget = function(target)
33 { 41 {
34 var model = /** @type {?WebInspector.SecurityModel} */ (target.model(WebInsp ector.SecurityModel)); 42 var model = /** @type {?WebInspector.SecurityModel} */ (target.model(WebInsp ector.SecurityModel));
35 if (!model) 43 if (!model)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations 107 * @param {!Array<!SecurityAgent.SecurityStateExplanation>=} explanations
100 * @param {!SecurityAgent.InsecureContentStatus=} insecureContentStatus 108 * @param {!SecurityAgent.InsecureContentStatus=} insecureContentStatus
101 * @param {boolean=} schemeIsCryptographic 109 * @param {boolean=} schemeIsCryptographic
102 */ 110 */
103 securityStateChanged: function(securityState, explanations, insecureContentS tatus, schemeIsCryptographic) 111 securityStateChanged: function(securityState, explanations, insecureContentS tatus, schemeIsCryptographic)
104 { 112 {
105 var pageSecurityState = new WebInspector.PageSecurityState(securityState , explanations || [], insecureContentStatus || null, schemeIsCryptographic || fa lse); 113 var pageSecurityState = new WebInspector.PageSecurityState(securityState , explanations || [], insecureContentStatus || null, schemeIsCryptographic || fa lse);
106 this._model.dispatchEventToListeners(WebInspector.SecurityModel.Events.S ecurityStateChanged, pageSecurityState); 114 this._model.dispatchEventToListeners(WebInspector.SecurityModel.Events.S ecurityStateChanged, pageSecurityState);
107 } 115 }
108 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698