Commit 1079fd94 authored by Nnamdi Theodore Johnson-Kanu's avatar Nnamdi Theodore Johnson-Kanu Committed by Commit Bot

[accessibility] Vocalize bluetooth peripherals subtext

Before this CL bluetooth device peripherals subtext where not being
vocalized by chromeVox, this CL adds subtext to vocalized string.

Bug: 1132975
Change-Id: Idabfe6abaf90f186c96d1b56952c911c7ba5fc53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2472585
Commit-Queue: Nnamdi Theodore Johnson-kanu <tjohnsonkanu@google.com>
Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Reviewed-by: default avatarRegan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818023}
parent 95a1087a
...@@ -126,16 +126,22 @@ Polymer({ ...@@ -126,16 +126,22 @@ Polymer({
* @private * @private
*/ */
getAriaLabel_(device) { getAriaLabel_(device) {
// We need to turn the device name and type into a single localized string. // We need to turn the device name, connection status and type into a single
// localized string.
// The possible device type enum values can be seen here: // The possible device type enum values can be seen here:
// https://developer.chrome.com/apps/bluetooth#type-Device. // https://developer.chrome.com/apps/bluetooth#type-Device.
// The localization id is computed dynamically to avoid maintaining a // The localization id is computed dynamically to avoid maintaining a
// mapping from the enum string value to the localization id. // mapping from the enum string value to the localization id.
// if device.type is not defined, we fall back to an unknown device string. // if device.type is not defined, we fall back to an unknown device string.
const deviceName = this.getDeviceName_(device); const deviceName = this.getDeviceName_(device);
return (device.type) ? const deviceStatus = this.getConnectionStatusText_(device);
const a11ydeviceNameAndType = (device.type) ?
this.i18n('bluetoothDeviceType_' + device.type, deviceName) : this.i18n('bluetoothDeviceType_' + device.type, deviceName) :
this.i18n('bluetoothDeviceType_unknown', deviceName); this.i18n('bluetoothDeviceType_unknown', deviceName);
return this.i18n(
'bluetoothDeviceWithConnectionStatus', a11ydeviceNameAndType,
deviceStatus);
}, },
/** /**
......
...@@ -159,6 +159,8 @@ void BluetoothSection::AddLoadTimeData(content::WebUIDataSource* html_source) { ...@@ -159,6 +159,8 @@ void BluetoothSection::AddLoadTimeData(content::WebUIDataSource* html_source) {
{"bluetoothRemove", IDS_SETTINGS_BLUETOOTH_REMOVE}, {"bluetoothRemove", IDS_SETTINGS_BLUETOOTH_REMOVE},
{"bluetoothPrimaryUserControlled", {"bluetoothPrimaryUserControlled",
IDS_SETTINGS_BLUETOOTH_PRIMARY_USER_CONTROLLED}, IDS_SETTINGS_BLUETOOTH_PRIMARY_USER_CONTROLLED},
{"bluetoothDeviceWithConnectionStatus",
IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_AND_CONNECTION_STATUS},
{"bluetoothDeviceType_computer", {"bluetoothDeviceType_computer",
IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_COMPUTER}, IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_COMPUTER},
{"bluetoothDeviceType_phone", {"bluetoothDeviceType_phone",
......
...@@ -278,6 +278,9 @@ This file contains the strings for bluetooth. ...@@ -278,6 +278,9 @@ This file contains the strings for bluetooth.
<message name="IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_UNKNOWN" desc="accessibility description for a device type that is not one of the known/supported device types for Chrome OS"> <message name="IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_UNKNOWN" desc="accessibility description for a device type that is not one of the known/supported device types for Chrome OS">
<ph name="DEVICE_NAME">$1<ex>Device XYZ</ex></ph>, Unknown device type <ph name="DEVICE_NAME">$1<ex>Device XYZ</ex></ph>, Unknown device type
</message> </message>
<message name="IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_AND_CONNECTION_STATUS" desc="accessibility description for a Bluetooth connectable device that includes its status. IDS_BLUETOOTH_ACCESSIBILITY_DEVICE_TYPE_* will be used as an input to DEVICE_NAME_AND_TYPE">
<ph name="DEVICE_NAME_AND_TYPE">$1<ex>Device XYZ, Audio Device</ex></ph> <ph name="CONNECTION_STATUS">$2<ex>Not connected</ex></ph>
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
......
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