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

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

Issue 2543633009: [Devtools] Template fromTarget() function calls to model (Closed)
Patch Set: fix Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/Target.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Security.SecurityModel = class extends SDK.SDKModel { 7 Security.SecurityModel = class extends SDK.SDKModel {
8 /** 8 /**
9 * @param {!SDK.Target} target 9 * @param {!SDK.Target} target
10 */ 10 */
11 constructor(target) { 11 constructor(target) {
12 super(Security.SecurityModel, target); 12 super(Security.SecurityModel, target);
13 this._dispatcher = new Security.SecurityDispatcher(this); 13 this._dispatcher = new Security.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 /** 19 /**
20 * @param {!SDK.Target} target 20 * @param {!SDK.Target} target
21 * @return {?Security.SecurityModel} 21 * @return {?Security.SecurityModel}
22 */ 22 */
23 static fromTarget(target) { 23 static fromTarget(target) {
24 var model = /** @type {?Security.SecurityModel} */ (target.model(Security.Se curityModel)); 24 var model = target.model(Security.SecurityModel);
25 if (!model) 25 if (!model)
26 model = new Security.SecurityModel(target); 26 model = new Security.SecurityModel(target);
27 return model; 27 return model;
28 } 28 }
29 29
30 /** 30 /**
31 * @param {!Protocol.Security.SecurityState} a 31 * @param {!Protocol.Security.SecurityState} a
32 * @param {!Protocol.Security.SecurityState} b 32 * @param {!Protocol.Security.SecurityState} b
33 * @return {number} 33 * @return {number}
34 */ 34 */
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 * @param {!Array<!Protocol.Security.SecurityStateExplanation>=} explanations 100 * @param {!Array<!Protocol.Security.SecurityStateExplanation>=} explanations
101 * @param {!Protocol.Security.InsecureContentStatus=} insecureContentStatus 101 * @param {!Protocol.Security.InsecureContentStatus=} insecureContentStatus
102 * @param {boolean=} schemeIsCryptographic 102 * @param {boolean=} schemeIsCryptographic
103 */ 103 */
104 securityStateChanged(securityState, explanations, insecureContentStatus, schem eIsCryptographic) { 104 securityStateChanged(securityState, explanations, insecureContentStatus, schem eIsCryptographic) {
105 var pageSecurityState = new Security.PageSecurityState( 105 var pageSecurityState = new Security.PageSecurityState(
106 securityState, explanations || [], insecureContentStatus || null, scheme IsCryptographic || false); 106 securityState, explanations || [], insecureContentStatus || null, scheme IsCryptographic || false);
107 this._model.dispatchEventToListeners(Security.SecurityModel.Events.SecurityS tateChanged, pageSecurityState); 107 this._model.dispatchEventToListeners(Security.SecurityModel.Events.SecurityS tateChanged, pageSecurityState);
108 } 108 }
109 }; 109 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/Target.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698