0

accessibility: set input toggle name accordingly with the input type.

BUG=b:365770092
TEST=manual test

Change-Id: I8919b4c4a7d1c8217a8f112e92c1faaabfc96548
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5852473
Commit-Queue: Zi Lin <lziest@google.com>
Reviewed-by: Istvan Nagy <iscsi@google.com>
Cr-Commit-Position: refs/heads/main@{#1354159}
This commit is contained in:
Zi Lin
2024-09-11 20:33:10 +00:00
committed by Chromium LUCI CQ
parent 32e599c6a2
commit ed79f80759
4 changed files with 23 additions and 4 deletions

@ -5239,6 +5239,12 @@ No devices connected.
<message name="IDS_ASH_AUTH_TEXTFIELD_PASSWORD_ACCESSIBLE_NAME" desc="The accessibility text for the authentication password textfield.">
Password
</message>
<message name="IDS_ASH_AUTH_DISPLAY_PIN_BUTTON_ACCESSIBLE_NAME_SHOW" desc="Text to be spoken when the focus is set to the display pin button (in Show state) on login screen and in-session auth dialog.">
Show PIN
</message>
<message name="IDS_ASH_AUTH_DISPLAY_PIN_BUTTON_ACCESSIBLE_NAME_HIDE" desc="Text to be spoken when the focus is set to the display pin button (in Hide state) on login screen and in-session auth dialog.">
Hide PIN
</message>
<!-- Fast Pair strings -->
<message name="IDS_FAST_PAIR_CONNECTION_ERROR_TITLE" desc="Notification title shown when a there is a Fast Pair connection error.">

@ -0,0 +1 @@
1919b47a3390db300f267f281de02ba6f584eddf

@ -0,0 +1 @@
4d2885183c435ac97a4b1cea2ccc3c339bd65ea0

@ -274,10 +274,21 @@ void AuthInputRowView::CreateAndConfigureDisplayTextButton() {
base::BindRepeating(&AuthInputRowView::ToggleTextDisplayingState,
base::Unretained(this))));
display_text_button_->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_LOGIN_DISPLAY_PASSWORD_BUTTON_ACCESSIBLE_NAME_SHOW));
display_text_button_->SetToggledTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_LOGIN_DISPLAY_PASSWORD_BUTTON_ACCESSIBLE_NAME_HIDE));
switch (auth_type_) {
case AuthType::kPassword:
display_text_button_->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_LOGIN_DISPLAY_PASSWORD_BUTTON_ACCESSIBLE_NAME_SHOW));
display_text_button_->SetToggledTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_LOGIN_DISPLAY_PASSWORD_BUTTON_ACCESSIBLE_NAME_HIDE));
break;
case AuthType::kPin:
display_text_button_->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_AUTH_DISPLAY_PIN_BUTTON_ACCESSIBLE_NAME_SHOW));
display_text_button_->SetToggledTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_AUTH_DISPLAY_PIN_BUTTON_ACCESSIBLE_NAME_HIDE));
break;
}
display_text_button_->SetFocusBehavior(FocusBehavior::ALWAYS);
display_text_button_->SetInstallFocusRingOnFocus(true);
views::FocusRing::Get(display_text_button_)