Commit 3c9d4548 authored by Livvie Lin's avatar Livvie Lin Committed by Commit Bot

Update PhishGuard password reuse dialog

Chromium screenshot: https://drive.google.com/file/d/1uNLiVaDEFTHzU5_NFkzzVffwyr-x2FCq/view?usp=sharing

Bug: 931812
Change-Id: Ie5b821530bd15efeb7e9b30389fec8e74fdbfc0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530115Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644461}
parent 93091cf9
...@@ -1219,7 +1219,10 @@ base::string16 ChromePasswordProtectionService::GetWarningDetailText( ...@@ -1219,7 +1219,10 @@ base::string16 ChromePasswordProtectionService::GetWarningDetailText(
if (GetSyncAccountType() != if (GetSyncAccountType() !=
safe_browsing::LoginReputationClientRequest::PasswordReuseEvent::GSUITE) { safe_browsing::LoginReputationClientRequest::PasswordReuseEvent::GSUITE) {
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS); return l10n_util::GetStringUTF16(
GetSyncAccountType() == PasswordReuseEvent::NOT_SIGNED_IN
? IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SIGNED_IN_NON_SYNC
: IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SYNC);
} }
std::string org_name = GetOrganizationName(password_type); std::string org_name = GetOrganizationName(password_type);
......
...@@ -1054,16 +1054,16 @@ TEST_F(ChromePasswordProtectionServiceTest, ...@@ -1054,16 +1054,16 @@ TEST_F(ChromePasswordProtectionServiceTest,
TEST_F(ChromePasswordProtectionServiceTest, TEST_F(ChromePasswordProtectionServiceTest,
VerifyGetWarningDetailTextEnterprise) { VerifyGetWarningDetailTextEnterprise) {
base::string16 default_warning_text = base::string16 warning_text_non_sync = l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS); IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SIGNED_IN_NON_SYNC);
base::string16 generic_enterprise_warning_text = l10n_util::GetStringUTF16( base::string16 generic_enterprise_warning_text = l10n_util::GetStringUTF16(
IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE); IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE);
base::string16 warning_text_with_org_name = l10n_util::GetStringFUTF16( base::string16 warning_text_with_org_name = l10n_util::GetStringFUTF16(
IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE_WITH_ORG_NAME, IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE_WITH_ORG_NAME,
base::UTF8ToUTF16("example.com")); base::UTF8ToUTF16("example.com"));
EXPECT_EQ(default_warning_text, service_->GetWarningDetailText( EXPECT_EQ(warning_text_non_sync, service_->GetWarningDetailText(
PasswordReuseEvent::SIGN_IN_PASSWORD)); PasswordReuseEvent::SIGN_IN_PASSWORD));
EXPECT_EQ( EXPECT_EQ(
generic_enterprise_warning_text, generic_enterprise_warning_text,
service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD)); service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD));
...@@ -1081,13 +1081,15 @@ TEST_F(ChromePasswordProtectionServiceTest, ...@@ -1081,13 +1081,15 @@ TEST_F(ChromePasswordProtectionServiceTest,
} }
TEST_F(ChromePasswordProtectionServiceTest, VerifyGetWarningDetailTextGmail) { TEST_F(ChromePasswordProtectionServiceTest, VerifyGetWarningDetailTextGmail) {
base::string16 default_warning_text = base::string16 warning_text_non_sync = l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS); IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SIGNED_IN_NON_SYNC);
base::string16 warning_text_sync =
l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SYNC);
base::string16 generic_enterprise_warning_text = l10n_util::GetStringUTF16( base::string16 generic_enterprise_warning_text = l10n_util::GetStringUTF16(
IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE); IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE);
EXPECT_EQ(default_warning_text, service_->GetWarningDetailText( EXPECT_EQ(warning_text_non_sync, service_->GetWarningDetailText(
PasswordReuseEvent::SIGN_IN_PASSWORD)); PasswordReuseEvent::SIGN_IN_PASSWORD));
EXPECT_EQ( EXPECT_EQ(
generic_enterprise_warning_text, generic_enterprise_warning_text,
service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD)); service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD));
...@@ -1096,8 +1098,8 @@ TEST_F(ChromePasswordProtectionServiceTest, VerifyGetWarningDetailTextGmail) { ...@@ -1096,8 +1098,8 @@ TEST_F(ChromePasswordProtectionServiceTest, VerifyGetWarningDetailTextGmail) {
CoreAccountInfo account_info = SetPrimaryAccount(kTestGmail); CoreAccountInfo account_info = SetPrimaryAccount(kTestGmail);
SetUpSyncAccount(kNoHostedDomainFound, account_info); SetUpSyncAccount(kNoHostedDomainFound, account_info);
EXPECT_EQ(PasswordReuseEvent::GMAIL, service_->GetSyncAccountType()); EXPECT_EQ(PasswordReuseEvent::GMAIL, service_->GetSyncAccountType());
EXPECT_EQ(default_warning_text, service_->GetWarningDetailText( EXPECT_EQ(warning_text_sync, service_->GetWarningDetailText(
PasswordReuseEvent::SIGN_IN_PASSWORD)); PasswordReuseEvent::SIGN_IN_PASSWORD));
EXPECT_EQ( EXPECT_EQ(
generic_enterprise_warning_text, generic_enterprise_warning_text,
service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD)); service_->GetWarningDetailText(PasswordReuseEvent::ENTERPRISE_PASSWORD));
......
...@@ -46,7 +46,8 @@ PasswordReuseModalWarningDialog::PasswordReuseModalWarningDialog( ...@@ -46,7 +46,8 @@ PasswordReuseModalWarningDialog::PasswordReuseModalWarningDialog(
: content::WebContentsObserver(web_contents), : content::WebContentsObserver(web_contents),
done_callback_(std::move(done_callback)), done_callback_(std::move(done_callback)),
service_(service), service_(service),
url_(web_contents->GetLastCommittedURL()) { url_(web_contents->GetLastCommittedURL()),
password_type_(password_type) {
// |service| maybe NULL in tests. // |service| maybe NULL in tests.
if (service_) if (service_)
service_->AddObserver(this); service_->AddObserver(this);
...@@ -131,7 +132,11 @@ base::string16 PasswordReuseModalWarningDialog::GetDialogButtonLabel( ...@@ -131,7 +132,11 @@ base::string16 PasswordReuseModalWarningDialog::GetDialogButtonLabel(
ui::DialogButton button) const { ui::DialogButton button) const {
switch (button) { switch (button) {
case ui::DIALOG_BUTTON_OK: case ui::DIALOG_BUTTON_OK:
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON); return l10n_util::GetStringUTF16(
password_type_ == safe_browsing::LoginReputationClientRequest::
PasswordReuseEvent::ENTERPRISE_PASSWORD
? IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON
: IDS_PAGE_INFO_PROTECT_ACCOUNT_BUTTON);
case ui::DIALOG_BUTTON_CANCEL: case ui::DIALOG_BUTTON_CANCEL:
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON); IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON);
......
...@@ -55,6 +55,7 @@ class PasswordReuseModalWarningDialog ...@@ -55,6 +55,7 @@ class PasswordReuseModalWarningDialog
OnWarningDone done_callback_; OnWarningDone done_callback_;
ChromePasswordProtectionService* service_; ChromePasswordProtectionService* service_;
const GURL url_; const GURL url_;
ReusedPasswordType password_type_;
DISALLOW_COPY_AND_ASSIGN(PasswordReuseModalWarningDialog); DISALLOW_COPY_AND_ASSIGN(PasswordReuseModalWarningDialog);
}; };
......
...@@ -388,6 +388,12 @@ ...@@ -388,6 +388,12 @@
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS" desc="A short paragraph explaining to the user that they has reuse their google password on current website."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS" desc="A short paragraph explaining to the user that they has reuse their google password on current website.">
You could lose access to your Google Account. Chrome recommends changing your password now. You'll be asked to sign in. You could lose access to your Google Account. Chrome recommends changing your password now. You'll be asked to sign in.
</message> </message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SYNC" desc="A short paragraph explaining to a Chrome sync user that they have reused their Google password on the current website.">
Chrome can help you protect your Google Account and change your password.
</message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SIGNED_IN_NON_SYNC" desc="A short paragraph explaining to a non-sync user that they have reused their Google password on the current website.">
Chrome can help you protect your Google Account and change your password. This will notify Google about this site.
</message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE" desc="A short paragraph explaining to the user that they have reused their password on the current website."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE" desc="A short paragraph explaining to the user that they have reused their password on the current website.">
You could lose access to your organization's account or experience identity theft. Chrome recommends changing your password now. You could lose access to your organization's account or experience identity theft. Chrome recommends changing your password now.
</message> </message>
...@@ -399,6 +405,12 @@ ...@@ -399,6 +405,12 @@
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS" desc="A short paragraph explaining to the user that they has reuse their google password on current website."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS" desc="A short paragraph explaining to the user that they has reuse their google password on current website.">
You could lose access to your Google Account. Chromium recommends changing your password now. You'll be asked to sign in. You could lose access to your Google Account. Chromium recommends changing your password now. You'll be asked to sign in.
</message> </message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SYNC" desc="A short paragraph explaining to a Chrome sync user that they have reused their Google password on the current website.">
Chromium can help you protect your Google Account and change your password.
</message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_SIGNED_IN_NON_SYNC" desc="A short paragraph explaining to a non-sync user that they have reused their Google password on the current website.">
Chromium can help you protect your Google Account and change your password. This will notify Google about this site.
</message>
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE" desc="A short paragraph explaining to the user that they have reused their password on the current website."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_DETAILS_ENTERPRISE" desc="A short paragraph explaining to the user that they have reused their password on the current website.">
You could lose access to your organization's account or experience identity theft. Chromium recommends changing your password now. You could lose access to your organization's account or experience identity theft. Chromium recommends changing your password now.
</message> </message>
...@@ -411,6 +423,9 @@ ...@@ -411,6 +423,9 @@
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON" desc="In Title Case: The string used in the page info change password button."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON" desc="In Title Case: The string used in the page info change password button.">
Change Password Change Password
</message> </message>
<message name="IDS_PAGE_INFO_PROTECT_ACCOUNT_BUTTON" desc="In Title Case: The string used in the page info protect account button.">
Protect Account
</message>
<message name="IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON" desc="In Title Case: The string used in the page info ignore password warning button."> <message name="IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON" desc="In Title Case: The string used in the page info ignore password warning button.">
Ignore Ignore
</message> </message>
...@@ -419,6 +434,9 @@ ...@@ -419,6 +434,9 @@
<message name="IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON" desc="The string used in the page info change password button."> <message name="IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON" desc="The string used in the page info change password button.">
Change password Change password
</message> </message>
<message name="IDS_PAGE_INFO_PROTECT_ACCOUNT_BUTTON" desc="The string used in the page info protect account button.">
Protect account
</message>
<message name="IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON" desc="The string used in the page info ignore password warning button."> <message name="IDS_PAGE_INFO_IGNORE_PASSWORD_WARNING_BUTTON" desc="The string used in the page info ignore password warning button.">
Ignore Ignore
</message> </message>
......
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