Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js |
| index e2ae631714b98feefaadb4734c7d70f098cec123..5796b9cade711eaabe899aab11baa83ce9852b6d 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js |
| @@ -92,13 +92,15 @@ Security.SecurityPanel = class extends UI.PanelWithSidebar { |
| /** |
| * @param {!Protocol.Security.SecurityState} newSecurityState |
| + * @param {?string} summaryOverride |
|
dgozman
2016/12/09 20:57:39
string
|
| + * @param {boolean} schemeIsCryptographic |
| * @param {!Array<!Protocol.Security.SecurityStateExplanation>} explanations |
| * @param {?Protocol.Security.InsecureContentStatus} insecureContentStatus |
| - * @param {boolean} schemeIsCryptographic |
| */ |
| - _updateSecurityState(newSecurityState, explanations, insecureContentStatus, schemeIsCryptographic) { |
| + _updateSecurityState(newSecurityState, summaryOverride, schemeIsCryptographic, explanations, insecureContentStatus) { |
| this._sidebarMainViewElement.setSecurityState(newSecurityState); |
| - this._mainView.updateSecurityState(newSecurityState, explanations, insecureContentStatus, schemeIsCryptographic); |
| + this._mainView.updateSecurityState( |
| + newSecurityState, summaryOverride, schemeIsCryptographic, explanations, insecureContentStatus); |
| } |
| /** |
| @@ -107,10 +109,12 @@ Security.SecurityPanel = class extends UI.PanelWithSidebar { |
| _onSecurityStateChanged(event) { |
| var data = /** @type {!Security.PageSecurityState} */ (event.data); |
| var securityState = /** @type {!Protocol.Security.SecurityState} */ (data.securityState); |
| + var summaryOverride = /** @type {string} */ (data.summaryOverride); |
| + var schemeIsCryptographic = /** @type {boolean} */ (data.schemeIsCryptographic); |
| var explanations = /** @type {!Array<!Protocol.Security.SecurityStateExplanation>} */ (data.explanations); |
| var insecureContentStatus = /** @type {?Protocol.Security.InsecureContentStatus} */ (data.insecureContentStatus); |
| - var schemeIsCryptographic = /** @type {boolean} */ (data.schemeIsCryptographic); |
| - this._updateSecurityState(securityState, explanations, insecureContentStatus, schemeIsCryptographic); |
| + this._updateSecurityState( |
| + securityState, summaryOverride, schemeIsCryptographic, explanations, insecureContentStatus); |
| } |
| selectAndSwitchToMainView() { |
| @@ -638,11 +642,12 @@ Security.SecurityMainView = class extends UI.VBox { |
| /** |
| * @param {!Protocol.Security.SecurityState} newSecurityState |
| + * @param {?string} summaryOverride |
|
dgozman
2016/12/09 20:57:39
string
|
| + * @param {boolean} schemeIsCryptographic |
| * @param {!Array<!Protocol.Security.SecurityStateExplanation>} explanations |
| * @param {?Protocol.Security.InsecureContentStatus} insecureContentStatus |
| - * @param {boolean} schemeIsCryptographic |
| */ |
| - updateSecurityState(newSecurityState, explanations, insecureContentStatus, schemeIsCryptographic) { |
| + updateSecurityState(newSecurityState, summaryOverride, schemeIsCryptographic, explanations, insecureContentStatus) { |
| // Remove old state. |
| // It's safe to call this even when this._securityState is undefined. |
| this._summarySection.classList.remove('security-summary-' + this._securityState); |
| @@ -656,7 +661,9 @@ Security.SecurityMainView = class extends UI.VBox { |
| 'neutral': Common.UIString('This page is not secure.'), |
| 'secure': Common.UIString('This page is secure (valid HTTPS).') |
| }; |
| - this._summaryText.textContent = summaryExplanationStrings[this._securityState]; |
| + |
| + // Use override summary if present, otherwise use base explanation |
| + this._summaryText.textContent = summaryOverride || summaryExplanationStrings[this._securityState]; |
|
dgozman
2016/12/09 20:57:39
It's always present, just use it.
We can also remo
|
| this._explanations = explanations, this._insecureContentStatus = insecureContentStatus; |
| this._schemeIsCryptographic = schemeIsCryptographic; |