[High5] Update auth error bubble message for pin-only
Bug: b:357606198, b:348326316 Change-Id: Idd8c7186a7ca4d737f0df81f93595932b9f78d1a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5872472 Reviewed-by: Denis Kuznetsov <antrim@chromium.org> Commit-Queue: Hardik Goyal <hardikgoyal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1358224}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
50b79903d3
commit
d97af8dee6
@ -4987,11 +4987,11 @@ No devices connected.
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING" desc="Couldn't sign in because PIN or password is invalid">
|
||||
Your PIN or password couldn't be verified. Try again.
|
||||
</message>
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING_2ND_TIME" desc="Couldn't sign in because PIN or password is invalid for the 2nd time">
|
||||
Your PIN or password still couldn't be verified. Note: If you recently changed your password, use your old password. Your new password will be applied once you sign out.
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PIN" desc="Couldn't sign in because PIN is invalid">
|
||||
Your PIN couldn't be verified. Try again.
|
||||
</message>
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING_2ND_TIME_NEW" desc="Couldn't sign in because PIN or password is invalid for the 2nd time">
|
||||
Your PIN or password still couldn't be verified. Try again.
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PIN_2ND_TIME" desc="Couldn't sign in because PIN is invalid for the 2nd time">
|
||||
Your PIN still couldn't be verified. Try again.
|
||||
</message>
|
||||
<message name="IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PWD" desc="Couldn't sign in because password is invalid">
|
||||
Your password couldn't be verified. Try again.
|
||||
|
@ -1 +0,0 @@
|
||||
c0b3838c7b527e797d3fe8f9872dbf2f720ae1cb
|
@ -0,0 +1 @@
|
||||
8c6dd6ee43a0a942c6239b14a750ab1098502add
|
@ -0,0 +1 @@
|
||||
8ae3e75eb7e983d6c2c3fdad1be6ee285d14c0b0
|
@ -99,13 +99,13 @@ AuthErrorBubble::~AuthErrorBubble() {}
|
||||
|
||||
void AuthErrorBubble::ShowAuthError(base::WeakPtr<views::View> anchor_view,
|
||||
int unlock_attempt,
|
||||
bool show_pin,
|
||||
bool authenticated_by_pin,
|
||||
bool is_login_screen) {
|
||||
std::u16string error_text;
|
||||
if (show_pin) {
|
||||
if (authenticated_by_pin) {
|
||||
error_text += l10n_util::GetStringUTF16(
|
||||
unlock_attempt > 1 ? IDS_ASH_LOGIN_ERROR_AUTHENTICATING_2ND_TIME_NEW
|
||||
: IDS_ASH_LOGIN_ERROR_AUTHENTICATING);
|
||||
unlock_attempt > 1 ? IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PIN_2ND_TIME
|
||||
: IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PIN);
|
||||
} else {
|
||||
error_text += l10n_util::GetStringUTF16(
|
||||
unlock_attempt > 1 ? IDS_ASH_LOGIN_ERROR_AUTHENTICATING_PWD_2ND_TIME
|
||||
@ -139,11 +139,11 @@ void AuthErrorBubble::ShowAuthError(base::WeakPtr<views::View> anchor_view,
|
||||
}
|
||||
|
||||
if (unlock_attempt > 1) {
|
||||
base::StrAppend(
|
||||
&error_text,
|
||||
{u"\n\n", l10n_util::GetStringUTF16(
|
||||
show_pin ? IDS_ASH_LOGIN_ERROR_RECOVER_USER
|
||||
: IDS_ASH_LOGIN_ERROR_RECOVER_USER_PWD)});
|
||||
base::StrAppend(&error_text,
|
||||
{u"\n\n", l10n_util::GetStringUTF16(
|
||||
authenticated_by_pin
|
||||
? IDS_ASH_LOGIN_ERROR_RECOVER_USER
|
||||
: IDS_ASH_LOGIN_ERROR_RECOVER_USER_PWD)});
|
||||
}
|
||||
|
||||
auto label = std::make_unique<views::StyledLabel>();
|
||||
|
@ -31,7 +31,7 @@ class ASH_EXPORT AuthErrorBubble : public LoginErrorBubble {
|
||||
|
||||
void ShowAuthError(base::WeakPtr<views::View> anchor_view,
|
||||
int unlock_attempt,
|
||||
bool show_pin,
|
||||
bool authenticated_by_pin,
|
||||
bool is_login_screen);
|
||||
|
||||
private:
|
||||
|
@ -1879,7 +1879,7 @@ void LockContentsView::OnAuthenticate(bool auth_success,
|
||||
}
|
||||
|
||||
if (display_error_messages) {
|
||||
ShowAuthErrorMessage();
|
||||
ShowAuthErrorMessage(authenticated_by_pin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2078,7 +2078,7 @@ LoginBigUserView* LockContentsView::CurrentBigUserView() {
|
||||
return primary_big_view_;
|
||||
}
|
||||
|
||||
void LockContentsView::ShowAuthErrorMessage() {
|
||||
void LockContentsView::ShowAuthErrorMessage(bool authenticated_by_pin) {
|
||||
LoginBigUserView* big_view = CurrentBigUserView();
|
||||
if (!big_view->auth_user()) {
|
||||
return;
|
||||
@ -2099,7 +2099,7 @@ void LockContentsView::ShowAuthErrorMessage() {
|
||||
auth_error_bubble_->ShowAuthError(
|
||||
/*anchor_view = */ big_view->auth_user()->GetActiveInputView(),
|
||||
/*unlock_attempt = */ unlock_attempt,
|
||||
/*show_pin = */ user_state->show_pin,
|
||||
/*authenticated_by_pin = */ authenticated_by_pin,
|
||||
/*is_login_screen = */ screen_type_ == LockScreen::ScreenType::kLogin);
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ class ASH_EXPORT LockContentsView
|
||||
LoginBigUserView* CurrentBigUserView();
|
||||
|
||||
// Opens an error bubble to indicate authentication failure.
|
||||
void ShowAuthErrorMessage();
|
||||
void ShowAuthErrorMessage(bool authenticated_by_pin);
|
||||
|
||||
// Hides the error bubble indicating authentication failure if open.
|
||||
void HideAuthErrorMessage();
|
||||
|
Reference in New Issue
Block a user