Commit e25e7642 authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

Set accessible name and role of LockContentsView.

This change sets the accessible name and role so that useful
content is read aloud to the user when this view is focused using
ChromeVox. This also fixes a bug where gibberish data was read when
invoking the "Read page title" ChromeVox hotkey combo on the lock
screen.

Bug: 887760
Change-Id: I6506620eb21afd59f696b41a1222d329e11ff34f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774829Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694813}
parent 90dacc8a
...@@ -1530,6 +1530,9 @@ This file contains the strings for ash. ...@@ -1530,6 +1530,9 @@ This file contains the strings for ash.
</message> </message>
<!-- Login screen strings --> <!-- Login screen strings -->
<message name="IDS_ASH_LOGIN_SCREEN_ACCESSIBLE_NAME" desc="Text that is spoken when requesting the login screen name.">
Login Screen
</message>
<message name="IDS_ASH_LOGIN_POD_PASSWORD_PLACEHOLDER" desc="Text to display as placeholder in the password field when password is the only auth method."> <message name="IDS_ASH_LOGIN_POD_PASSWORD_PLACEHOLDER" desc="Text to display as placeholder in the password field when password is the only auth method.">
Password Password
</message> </message>
...@@ -2005,6 +2008,9 @@ This file contains the strings for ash. ...@@ -2005,6 +2008,9 @@ This file contains the strings for ash.
</message> </message>
<!-- Lock Screen Media Controls --> <!-- Lock Screen Media Controls -->
<message name="IDS_ASH_LOCK_SCREEN_ACCESSIBLE_NAME" desc="Text that is spoken when requesting the lock screen name.">
Lock Screen
</message>
<message name="IDS_ASH_LOCK_SCREEN_MEDIA_CONTROLS_ACTION_PREVIOUS_TRACK" desc="The button to trigger media playback to go to the previous track."> <message name="IDS_ASH_LOCK_SCREEN_MEDIA_CONTROLS_ACTION_PREVIOUS_TRACK" desc="The button to trigger media playback to go to the previous track.">
Previous Track Previous Track
</message> </message>
......
...@@ -640,9 +640,12 @@ void LockContentsView::GetAccessibleNodeData(ui::AXNodeData* node_data) { ...@@ -640,9 +640,12 @@ void LockContentsView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
Shelf* shelf = Shelf::ForWindow(GetWidget()->GetNativeWindow()); Shelf* shelf = Shelf::ForWindow(GetWidget()->GetNativeWindow());
ShelfWidget* shelf_widget = shelf->shelf_widget(); ShelfWidget* shelf_widget = shelf->shelf_widget();
GetViewAccessibility().OverrideNextFocus(shelf_widget); GetViewAccessibility().OverrideNextFocus(shelf_widget);
GetViewAccessibility().OverridePreviousFocus(shelf->GetStatusAreaWidget()); GetViewAccessibility().OverridePreviousFocus(shelf->GetStatusAreaWidget());
node_data->SetNameExplicitlyEmpty(); node_data->SetName(
l10n_util::GetStringUTF16(screen_type_ == LockScreen::ScreenType::kLogin
? IDS_ASH_LOGIN_SCREEN_ACCESSIBLE_NAME
: IDS_ASH_LOCK_SCREEN_ACCESSIBLE_NAME));
node_data->role = ax::mojom::Role::kWindow;
} }
bool LockContentsView::AcceleratorPressed(const ui::Accelerator& accelerator) { bool LockContentsView::AcceleratorPressed(const ui::Accelerator& accelerator) {
......
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