Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @constructor | |
| 7 * @extends {WebInspector.SDKModel} | |
| 8 * @param {!WebInspector.Target} target | |
| 9 */ | |
| 10 WebInspector.SecurityManager = function(target) | |
|
dgozman
2015/06/03 10:12:35
Move this to security module, do not add to sdk.
lgarron
2015/06/11 22:54:46
What is the reason to add something to sdk vs. not
dgozman
2015/06/12 06:20:22
If the thing is self-contained, and nobody depends
| |
| 11 { | |
| 12 WebInspector.SDKModel.call(this, WebInspector.SecurityManager, target); | |
| 13 this._dispatcher = new WebInspector.SecurityDispatcher(this); | |
| 14 this._target = target; | |
| 15 this._securityAgent = target.securityAgent(); | |
| 16 target.registerSecurityDispatcher(this._dispatcher); | |
| 17 this._securityAgent.enable(); | |
| 18 } | |
| 19 | |
| 20 WebInspector.SecurityManager.EventTypes = { | |
| 21 SecurityStateChanged: "SecurityStateChanged" | |
| 22 } | |
| 23 | |
| 24 WebInspector.SecurityManager.prototype = { | |
| 25 targetAdded: function () {}, | |
| 26 __proto__: WebInspector.SDKModel.prototype | |
| 27 } | |
| 28 | |
| 29 /** | |
| 30 * @constructor | |
| 31 * @implements {SecurityAgent.Dispatcher} | |
| 32 */ | |
| 33 WebInspector.SecurityDispatcher = function(manager) | |
| 34 { | |
| 35 this._manager = manager; | |
| 36 } | |
| 37 | |
| 38 WebInspector.SecurityDispatcher.prototype = { | |
| 39 /** | |
| 40 * @override | |
| 41 * @param {!SecurityAgent.SecurityState} securityState | |
| 42 */ | |
| 43 securityStateChanged: function(securityState) | |
| 44 { | |
| 45 // console.log("DISPATCHING security state", securityState); | |
| 46 this._manager.dispatchEventToListeners(WebInspector.SecurityManager.Even tTypes.SecurityStateChanged, securityState); | |
| 47 return; | |
| 48 } | |
| 49 } | |
| OLD | NEW |