Commit caa4f985 authored by Christos Froussios's avatar Christos Froussios Committed by Commit Bot

[Password Manager] More Actions aria labels for chrome:settings/passwords

The aria labels for the 'More Actions' buttons will now also give context,
mentioning whether the apply to all passwords or the specific user and
domain.

Bug: 828312
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: If94daaa5b6a903b3e0887caea13a2446eef52bfd
Reviewed-on: https://chromium-review.googlesource.com/964330Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Christos Froussios <cfroussios@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548777}
parent 656cb984
...@@ -710,6 +710,12 @@ ...@@ -710,6 +710,12 @@
<message name="IDS_SETTINGS_PASSWORDS_EXPORTING_FAILURE_TIP_ANOTHER_FOLDER" desc="Message that is shown when exporting passwords has failed. This is part of a list of things the user can try to resolve the problem. This advice implies that Chrome couldn't write into the specified folder."> <message name="IDS_SETTINGS_PASSWORDS_EXPORTING_FAILURE_TIP_ANOTHER_FOLDER" desc="Message that is shown when exporting passwords has failed. This is part of a list of things the user can try to resolve the problem. This advice implies that Chrome couldn't write into the specified folder.">
Export your passwords to another folder Export your passwords to another folder
</message> </message>
<message name="IDS_SETTINGS_PASSWORD_ROW_MORE_ACTIONS" desc="The ARIA (accessibility) message for the More Actions button, which sits in every row of the password list. It opens a menu with a list of actions, which apply to the username-password pair on this row.">
More actions, password for <ph name="USERNAME">$1<ex>example@gmail.com</ex></ph> on <ph name="DOMAIN">$2<ex>www.google.com</ex></ph>
</message>
<message name="IDS_SETTINGS_PASSWORD_ROW_FEDERATED_MORE_ACTIONS" desc="The ARIA (accessibility) message for the More Actions button, which sits in every row of the password list. For this row does not include a password, only information of the account. It opens a menu with a list of actions, which apply to the account presented on this row.">
More actions, saved account for <ph name="USERNAME">$1<ex>example@gmail.com</ex></ph> on <ph name="DOMAIN">$2<ex>www.google.com</ex></ph>
</message>
<!-- Default Browser Page --> <!-- Default Browser Page -->
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
'target_name': 'password_list_item', 'target_name': 'password_list_item',
'dependencies': [ 'dependencies': [
'../compiled_resources2.gyp:focus_row_behavior', '../compiled_resources2.gyp:focus_row_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
'show_password_behavior', 'show_password_behavior',
], ],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
......
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
<button id="passwordMenu" <button id="passwordMenu"
on-click="onPasswordMenuTap_" on-click="onPasswordMenuTap_"
title="$i18n{moreActions}" focus-row-control title="$i18n{moreActions}" focus-row-control
focus-type="passwordMenu"> focus-type="passwordMenu"
aria-label$="[[getMoreActionsLabel_(item)]]">
</button> </button>
</paper-icon-button-light> </paper-icon-button-light>
</div> </div>
......
...@@ -29,4 +29,22 @@ Polymer({ ...@@ -29,4 +29,22 @@ Polymer({
this.fire( this.fire(
'password-menu-tap', {target: this.$.passwordMenu, listItem: this}); 'password-menu-tap', {target: this.$.passwordMenu, listItem: this});
}, },
/**
* Get the aria label for the More Actions button on this row.
* @param {{
* entry: !chrome.passwordsPrivate.PasswordUiEntry,
* password: string
* }} item This row's item.
* @private
*/
getMoreActionsLabel_: function(item) {
// Avoid using I18nBehavior.i18n, because it will filter sequences, which
// are otherwise not illegal for usernames. Polymer still protects against
// XSS injection.
return loadTimeData.getStringF(
(item.entry.federationText) ? 'passwordRowFederatedMoreActionsButton' :
'passwordRowMoreActionsButton',
item.entry.loginPair.username, item.entry.loginPair.urls.shown);
},
}); });
...@@ -84,7 +84,9 @@ ...@@ -84,7 +84,9 @@
<span>$i18nRaw{managePasswordsLabel}</span> <span>$i18nRaw{managePasswordsLabel}</span>
</div> </div>
<div class="settings-box first"> <div class="settings-box first">
<h2 class="start">$i18n{savedPasswordsHeading}</h2> <h2 id="savedPasswordsHeading" class="start">
$i18n{savedPasswordsHeading}
</h2>
<template is="dom-if" <template is="dom-if"
if="[[showImportOrExportPasswords_( if="[[showImportOrExportPasswords_(
showExportPasswords_, showImportPasswords_)]]"> showExportPasswords_, showImportPasswords_)]]">
...@@ -92,7 +94,8 @@ ...@@ -92,7 +94,8 @@
class="icon-more-vert"> class="icon-more-vert">
<button id="exportImportMenuButton" <button id="exportImportMenuButton"
on-click="onImportExportMenuTap_" on-click="onImportExportMenuTap_"
title="$i18n{moreActions}" focus-type="exportImportMenuButton"> title="$i18n{moreActions}" focus-type="exportImportMenuButton"
aria-describedby="savedPasswordsHeading">
</button> </button>
</paper-icon-button-light> </paper-icon-button-light>
</template> </template>
......
...@@ -1381,6 +1381,9 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) { ...@@ -1381,6 +1381,9 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
{"exportMenuItem", IDS_SETTINGS_PASSWORDS_EXPORT_MENU_ITEM}, {"exportMenuItem", IDS_SETTINGS_PASSWORDS_EXPORT_MENU_ITEM},
{"undoRemovePassword", IDS_SETTINGS_PASSWORD_UNDO}, {"undoRemovePassword", IDS_SETTINGS_PASSWORD_UNDO},
{"passwordDeleted", IDS_SETTINGS_PASSWORD_DELETED_PASSWORD}, {"passwordDeleted", IDS_SETTINGS_PASSWORD_DELETED_PASSWORD},
{"passwordRowMoreActionsButton", IDS_SETTINGS_PASSWORD_ROW_MORE_ACTIONS},
{"passwordRowFederatedMoreActionsButton",
IDS_SETTINGS_PASSWORD_ROW_FEDERATED_MORE_ACTIONS},
{"exportPasswordsTitle", IDS_SETTINGS_PASSWORDS_EXPORT_TITLE}, {"exportPasswordsTitle", IDS_SETTINGS_PASSWORDS_EXPORT_TITLE},
{"exportPasswordsDescription", IDS_SETTINGS_PASSWORDS_EXPORT_DESCRIPTION}, {"exportPasswordsDescription", IDS_SETTINGS_PASSWORDS_EXPORT_DESCRIPTION},
{"exportPasswords", IDS_SETTINGS_PASSWORDS_EXPORT}, {"exportPasswords", IDS_SETTINGS_PASSWORDS_EXPORT},
......
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