Commit 1373858e authored by Viktor Semeniuk's avatar Viktor Semeniuk Committed by Commit Bot

[Passwords] No compromised credentials found

This change adds UI for the case when no leaked credentials were
detected after password check.

Bug: 1047726
Change-Id: Ifa383a09e764a2dbd5286ef542f78c6c95f63692
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087711Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
Cr-Commit-Position: refs/heads/master@{#747686}
parent b8ffaf4c
...@@ -347,6 +347,9 @@ ...@@ -347,6 +347,9 @@
<message name="IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_PHISHED" desc="Password compromise reason shown when a password was reused on a phishing site."> <message name="IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_PHISHED" desc="Password compromise reason shown when a password was reused on a phishing site.">
Entered on deceptive site Entered on deceptive site
</message> </message>
<message name="IDS_SETTINGS_NO_COMPROMISED_CREDENTIALS_LABEL" desc="Label which is shown when there were no compromised passwords detected.">
Chrome will notify you when you sign in with a compromised password
</message>
<message name="IDS_SETTINGS_PASSWORDS_SAVE_PASSWORDS_TOGGLE_LABEL" desc="Label for a toggle that allows users to be prompted if they want to save their passwords when logging into webpages."> <message name="IDS_SETTINGS_PASSWORDS_SAVE_PASSWORDS_TOGGLE_LABEL" desc="Label for a toggle that allows users to be prompted if they want to save their passwords when logging into webpages.">
Offer to save passwords Offer to save passwords
</message> </message>
......
d32cf4d916e0a0554820938d144d3cf4bc07440e
\ No newline at end of file
...@@ -38,6 +38,12 @@ ...@@ -38,6 +38,12 @@
$i18n{checkPasswordsAgain} $i18n{checkPasswordsAgain}
</cr-button> </cr-button>
</div> </div>
<div id="noCompromisedCredentials"
hidden$="[[hasLeakedCredentials_(leakedPasswords)]]">
<div class="settings-box secondary">
$i18n{noCompromisedCredentials}
</div>
</div>
<div id="passwordCheckBody" <div id="passwordCheckBody"
hidden$="[[!hasLeakedCredentials_(leakedPasswords)]]"> hidden$="[[!hasLeakedCredentials_(leakedPasswords)]]">
<div class="settings-box"> <div class="settings-box">
......
...@@ -739,6 +739,8 @@ void AddAutofillStrings(content::WebUIDataSource* html_source, ...@@ -739,6 +739,8 @@ void AddAutofillStrings(content::WebUIDataSource* html_source,
{"changePasswordButton", IDS_SETTINGS_CHANGE_PASSWORD_BUTTON}, {"changePasswordButton", IDS_SETTINGS_CHANGE_PASSWORD_BUTTON},
{"leakedPassword", IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_LEAKED}, {"leakedPassword", IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_LEAKED},
{"phishedPassword", IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_PHISHED}, {"phishedPassword", IDS_SETTINGS_COMPROMISED_PASSWORD_REASON_PHISHED},
{"noCompromisedCredentials",
IDS_SETTINGS_NO_COMPROMISED_CREDENTIALS_LABEL},
{"creditCards", IDS_AUTOFILL_PAYMENT_METHODS}, {"creditCards", IDS_AUTOFILL_PAYMENT_METHODS},
{"noPaymentMethodsFound", IDS_SETTINGS_PAYMENT_METHODS_NONE}, {"noPaymentMethodsFound", IDS_SETTINGS_PAYMENT_METHODS_NONE},
{"googlePayments", IDS_SETTINGS_GOOGLE_PAYMENTS}, {"googlePayments", IDS_SETTINGS_GOOGLE_PAYMENTS},
......
...@@ -70,6 +70,7 @@ cr.define('settings_passwords_check', function() { ...@@ -70,6 +70,7 @@ cr.define('settings_passwords_check', function() {
test('testNoCompromisedCredentials', function() { test('testNoCompromisedCredentials', function() {
const checkPasswordSection = createCheckPasswordSection(); const checkPasswordSection = createCheckPasswordSection();
assertTrue(checkPasswordSection.$.passwordCheckBody.hidden); assertTrue(checkPasswordSection.$.passwordCheckBody.hidden);
assertFalse(checkPasswordSection.$.noCompromisedCredentials.hidden);
validateLeakedPasswordsList( validateLeakedPasswordsList(
checkPasswordSection.$.leakedPasswordList, []); checkPasswordSection.$.leakedPasswordList, []);
}); });
...@@ -91,6 +92,7 @@ cr.define('settings_passwords_check', function() { ...@@ -91,6 +92,7 @@ cr.define('settings_passwords_check', function() {
.then(() => { .then(() => {
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse(checkPasswordSection.$.passwordCheckBody.hidden); assertFalse(checkPasswordSection.$.passwordCheckBody.hidden);
assertTrue(checkPasswordSection.$.noCompromisedCredentials.hidden);
validateLeakedPasswordsList( validateLeakedPasswordsList(
checkPasswordSection.$.leakedPasswordList, leakedPasswords); checkPasswordSection.$.leakedPasswordList, leakedPasswords);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment