Commit 5a3c957e authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[SmartLock] Provide a11y labels for when device becomes unlockable.

Update accessibility name of Smart Lock icon when the Chromebook can be
unlocked via Smart Lock, and update accessibility name of password
field to communicate to a11y users that they can unlock by simply
pressing Enter.

Fixes: 1007036
Change-Id: Id65ceaa44428946afb3321c11c863c08954b38d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1905049
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714629}
parent 23898e80
......@@ -1667,6 +1667,9 @@ This file contains the strings for ash.
<message name="IDS_ASH_LOGIN_POD_SMART_CARD_PIN_FIELD_ACCESSIBLE_NAME" desc="Text to be spoken when the focus is set to the security token PIN input field of a user pod on the sign-in screen.">
Smart card PIN for <ph name="USER_EMAIL_ADDRESS">$1<ex>john.doe@example.com</ex></ph>
</message>
<message name="IDS_ASH_LOGIN_POD_AUTH_TAP_PASSWORD_FIELD_ACCESSIBLE_NAME" desc="Text to be spoken when the focus is set to the password field of a user pod on the sign-in screen, and authentication by tap is enabled.">
Press Enter to unlock for <ph name="USER_EMAIL_ADDRESS">$1<ex>john.doe@example.com</ex></ph>
</message>
<message name="IDS_ASH_LOGIN_SUBMIT_BUTTON_ACCESSIBLE_NAME" desc="Text to be spoken when the focus is set to the submit button on login screen.">
Submit
</message>
......
......@@ -1090,6 +1090,18 @@ void LoginAuthUserView::SetEasyUnlockIcon(
EasyUnlockIconId id,
const base::string16& accessibility_label) {
password_view_->SetEasyUnlockIcon(id, accessibility_label);
const std::string& user_display_email =
current_user().basic_user_info.display_email;
if (id == EasyUnlockIconId::UNLOCKED) {
password_view_->SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_ASH_LOGIN_POD_AUTH_TAP_PASSWORD_FIELD_ACCESSIBLE_NAME,
base::UTF8ToUTF16(user_display_email)));
} else {
password_view_->SetAccessibleName(l10n_util::GetStringFUTF16(
IDS_ASH_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME,
base::UTF8ToUTF16(user_display_email)));
}
}
void LoginAuthUserView::CaptureStateForAnimationPreLayout() {
......
......@@ -3825,6 +3825,9 @@
<message name="IDS_SMART_LOCK_SPINNER_ACCESSIBILITY_LABEL" desc="Label for the spinner icon used for accessibility purposes. This label is needed because this state does not have a tooltip.">
Finding your phone
</message>
<message name="IDS_SMART_LOCK_SCREENLOCK_AUTHENTICATED_LABEL" desc="Label for the Smart Lock icon used for accessibility purposes. Describes when a phone eligible to unlock the Chromebook is detected and authenticated.">
Your device is unlocked with Smart Lock. Press Enter to unlock.
</message>
<!-- User Image Selection Dialog -->
<message name="IDS_USER_IMAGE_SCREEN_TITLE" desc="String to be displayed in the title bar of the oobe/login user image selection dialog">
......
......@@ -191,6 +191,13 @@ void EasyUnlockScreenlockStateHandler::ChangeState(ScreenlockState new_state) {
l10n_util::GetStringUTF16(IDS_SMART_LOCK_SPINNER_ACCESSIBILITY_LABEL));
}
// Accessibility users may not be able to see the green icon which indicates
// the phone is authenticated. Provide message to that effect.
if (state_ == ScreenlockState::AUTHENTICATED) {
icon_options.SetAriaLabel(l10n_util::GetStringUTF16(
IDS_SMART_LOCK_SCREENLOCK_AUTHENTICATED_LABEL));
}
screenlock_bridge_->lock_handler()->ShowUserPodCustomIcon(account_id_,
icon_options);
}
......
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