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

Unified Diff: Source/devtools/front_end/security/SecurityModel.js

Issue 1179353002: Surface lock icon explanations in the DevTools Security panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Additional linter annotations. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/security/SecurityModel.js
diff --git a/Source/devtools/front_end/security/SecurityModel.js b/Source/devtools/front_end/security/SecurityModel.js
index e9e75c23608b3d0e01813426c314116b6f5efeeb..5fea33a0c155163ff7f54aba177b5e348c006c21 100644
--- a/Source/devtools/front_end/security/SecurityModel.js
+++ b/Source/devtools/front_end/security/SecurityModel.js
@@ -15,13 +15,21 @@ WebInspector.SecurityModel = function(target)
target.registerSecurityDispatcher(this._dispatcher);
this._securityAgent.enable();
- this._securityState = "unknown";
+ this._securityState = /** @type {!SecurityAgent.SecurityState} */ ("unknown");
}
WebInspector.SecurityModel.EventTypes = {
SecurityStateChanged: "SecurityStateChanged"
}
+/** @typedef {!{
dgozman 2015/06/18 10:50:48 Just put this in a single line.
lgarron 2015/06/18 18:16:18 Done.
+ securityState: SecurityAgent.SecurityState,
+ summary: string,
+ description: string
+ }}
+ */
+WebInspector.SecurityModel.SecurityStateExplanation;
+
WebInspector.SecurityModel.prototype = {
/**
* @return {!SecurityAgent.SecurityState} securityState
@@ -55,14 +63,25 @@ WebInspector.SecurityDispatcher = function(model)
this._model = model;
}
+/** @typedef {!{
dgozman 2015/06/18 10:50:48 We don't usually typdef events, since you will cas
lgarron 2015/06/18 18:16:17 Done.
+ securityState: !SecurityAgent.SecurityState,
+ explanations: !Array<!WebInspector.SecurityModel.SecurityStateExplanation>
+ }}
+ */
+WebInspector.SecurityDispatcher.SecurityStateChangedEvent;
+
WebInspector.SecurityDispatcher.prototype = {
/**
* @override
* @param {!SecurityAgent.SecurityState} securityState
+ * @param {!Array<!WebInspector.SecurityModel.SecurityStateExplanation>=} explanations
*/
- securityStateChanged: function(securityState)
+ securityStateChanged: function(securityState, explanations)
{
- this._model._securityState = securityState;
- this._model.dispatchEventToListeners(WebInspector.SecurityModel.EventTypes.SecurityStateChanged, securityState);
+ var event = /** @type {!WebInspector.SecurityDispatcher.SecurityStateChangedEvent} */ ({
+ "securityState": securityState,
+ "explanations": explanations || []
+ });
+ this._model.dispatchEventToListeners(WebInspector.SecurityModel.EventTypes.SecurityStateChanged, event);
dgozman 2015/06/18 10:50:48 event->data
lgarron 2015/06/18 18:16:18 Good point. Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698