Commit b643d8d6 authored by Eleonora Rocchi's avatar Eleonora Rocchi Committed by Commit Bot

[PwdCheckAndroid] Add text to the status header in Check passwords.

This CL adds the logic to fill the text describing the status of the
last/current check. It also adds tests to verify the correct messages
are displayed.

IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_OFFLINE.png.sha1 image:
https://storage.cloud.google.com/chromium-translation-screenshots/fcb59be745a5ffbb21fcd8f78f1608f6817910d7

IDS_PASSWORD_CHECK_STATUS_MESSAGE_RUNNING.png.sha1 image:
https://storage.cloud.google.com/chromium-translation-screenshots/7ed062035e44451197ebccfc7a52e9297e669c40

IDS_PASSWORD_CHECK_STATUS_MESSAGE_SUCCESS_NO_LEAKS.png.sha1 image:
https://storage.cloud.google.com/chromium-translation-screenshots/693aefb5231f2fa632d467c4febe56e5f4cd28b4

IDS_PASSWORD_CHECK_STATUS_MESSAGE_SUCCESS_WITH_LEAKS.png.sha1 image:
https://storage.cloud.google.com/chromium-translation-screenshots/f49f6f620eb105d574ea8b989701a56f6ec02b8b

Bug: 1109691, 1092444
Change-Id: I41144279472e00062fd12b91e8c645c3a283bf61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2322486
Commit-Queue: Eleonora Rocchi <erocchi@google.com>
Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795874}
parent e64d8c93
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<TextView <TextView
android:id="@+id/check_status_description" android:id="@+id/check_status_description"
android:layout_marginTop="@dimen/check_status_description_margin_top"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:textAppearance="@style/TextAppearance.TextSmall.Secondary" android:textAppearance="@style/TextAppearance.TextSmall.Secondary"
......
...@@ -4,11 +4,17 @@ ...@@ -4,11 +4,17 @@
found in the LICENSE file. --> found in the LICENSE file. -->
<resources> <resources>
<dimen name="check_status_description_margin_top">2dp</dimen>
<dimen name="check_status_icon_margin_horizontal">16dp</dimen> <dimen name="check_status_icon_margin_horizontal">16dp</dimen>
<dimen name="check_status_icon_size">24dp</dimen> <dimen name="check_status_icon_size">24dp</dimen>
<dimen name="check_status_restart_button_clickable_surface_size">48dp</dimen> <dimen name="check_status_restart_button_clickable_surface_size">48dp</dimen>
<dimen name="check_status_restart_button_margin_end">4dp</dimen> <dimen name="check_status_restart_button_margin_end">4dp</dimen>
<!-- Margin for the header message, it depends on the status -->
<dimen name="check_status_message_error_margin_vertical">24dp</dimen>
<dimen name="check_status_message_idle_margin_vertical">27dp</dimen>
<dimen name="check_status_message_running_margin_vertical">36dp</dimen>
<dimen name="compromised_credential_row_button_margin_top">16dp</dimen> <dimen name="compromised_credential_row_button_margin_top">16dp</dimen>
<dimen name="compromised_credential_row_more_padding_end">8dp</dimen> <dimen name="compromised_credential_row_more_padding_end">8dp</dimen>
<dimen name="compromised_credential_row_more_padding_start">16dp</dimen> <dimen name="compromised_credential_row_more_padding_start">16dp</dimen>
......
...@@ -187,10 +187,49 @@ ...@@ -187,10 +187,49 @@
<message name="IDS_PASSWORD_CHECK_CREDENTIAL_ROW_SCRIPT_BUTTON_EXPLANATION" desc="Small description explaining that an automated password change can be done with a script."> <message name="IDS_PASSWORD_CHECK_CREDENTIAL_ROW_SCRIPT_BUTTON_EXPLANATION" desc="Small description explaining that an automated password change can be done with a script.">
Let Google Assistant help you change your password Let Google Assistant help you change your password
</message> </message>
<message name="IDS_PASSWORD_CHECK_STATUS_DESCRIPTION_IDLE" desc="Small description explaining that the password check has been completed and showing how long ago the last check has been successfully completed.">
Checked passwords · <ph name="TIME_SINCE_LAST_CHECK">%1$s<ex>Just now</ex></ph>
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_NO_PASSWORDS" desc="Error message explaining that the password check failed because the user has no passwords on this device.">
No saved passwords. Chrome can check your passwords when you save them.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_OFFLINE" desc="Error message explaining that the password check failed because the user is offline.">
Chrome can't check your passwords. Try checking your internet connection.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_QUOTA_LIMIT" desc="Error message explaining that the password check failed because the user has exceeded their quota.">
Chrome couldn't check all passwords. Try again tomorrow.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_QUOTA_LIMIT_ACCOUNT_CHECK" desc="Error message explaining that the password check failed because the user has exceeded their quota and redirecting to check in the Google Account.">
Chrome couldn't check all passwords. Try again tomorrow or check passwords in your Google Account.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_SIGNED_OUT" desc="Error message explaining that the password check failed because the user is signed-out.">
Chrome can check your passwords when you sign in with your Google Account.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_ERROR_UNKNOWN" desc="Error message explaining that the password check failed for unknown reasons.">
Chrome can't check your passwords. Try again.
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_IDLE_NO_LEAKS" desc="Message explaining that the password check has been completed and no leaked passwords have been found.">
No compromised passwords
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_IDLE_WITH_LEAKS" desc="Message explaining that the password check has been completed and some leaked passwords have been found.">
{COMPROMISED_PASSWORDS, plural, =1 {# compromised password} other {# compromised passwords}}
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_INITIAL_RUNNING" desc="Status message shown when the check for leaked passwords is running and we have not yet information regarding the progress.">
Checking passwords…
</message>
<message name="IDS_PASSWORD_CHECK_STATUS_MESSAGE_RUNNING" desc="Status message shown when the check for leaked passwords is running.">
Checking passwords (<ph name="ANALYSED_PASSWORDS">%1$s<ex>1</ex></ph> of <ph name="TOTAL_PASSWORDS">%2$s<ex>42</ex></ph>)…
</message>
<!-- Accessibility strings --> <!-- Accessibility strings -->
<message name="IDS_ACCESSIBILITY_PASSWORD_CHECK_RESTART_BUTTON" desc="Content description for the button to restart the password check."> <message name="IDS_ACCESSIBILITY_PASSWORD_CHECK_RESTART_BUTTON" desc="Content description for the button to restart the password check.">
Restart password check Restart password check
</message> </message>
<!-- Utility string to show the timestamp -->
<message name="IDS_PASSWORD_CHECK_JUST_NOW" desc="A time label for a check that happened just now. For example 'Checked passwords · Just now'">
Just now
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
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