Commit 499570b6 authored by Hector Carmona's avatar Hector Carmona Committed by Commit Bot

MD Extensions - A11y: Announce when an extension has been updated.

Bug: 27175
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2fed4c16cf0406ea5361413840fe5ab2f5968f69
Reviewed-on: https://chromium-review.googlesource.com/1003056
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551142}
parent f0295ade
......@@ -78,6 +78,9 @@
<message name="IDS_MD_EXTENSIONS_ITEM_DETAILS" desc="The text on the button to show more details for a given extension.">
Details
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_RELOAD_DONE" desc="Text used to announce when a single extension has been updated. This is for accessibility.">
Extension reloaded
</message>
<message name="IDS_MD_EXTENSIONS_EXTENSION_A11Y_ASSOCIATION" desc="Label used to associate an app or extension with actions a user can take. This label is for screen readers and will only be read out lout. Ex: a button labeled 'Delete' would have the description 'Related to AdBlock'. Without the added description a user on a screen reader would not have context of the extension they want to delete. Note that the action can be 'view details', 'enable', 'delete', 'errors', or something else.">
Related to <ph name="NAME_PH">$1<ex>AdBlock</ex></ph>
</message>
......
......@@ -186,11 +186,20 @@ cr.define('extensions', function() {
{page: Page.DETAILS, extensionId: this.data.id});
},
/** @private */
onReloadTap_: function() {
this.delegate.reloadItem(this.data.id).catch(loadError => {
this.fire('load-error', loadError);
});
/**
* @param {Event} e
* @private
*/
onReloadTap_: function(e) {
this.delegate.reloadItem(this.data.id)
.then(
() => {
Polymer.IronA11yAnnouncer.requestAvailability();
this.fire('iron-announce', {text: this.i18n('itemReloadDone')});
},
loadError => {
this.fire('load-error', loadError);
});
},
/** @private */
......
......@@ -202,6 +202,8 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
source->AddLocalizedString("itemDependentEntry",
IDS_MD_EXTENSIONS_DEPENDENT_ENTRY);
source->AddLocalizedString("itemDetails", IDS_MD_EXTENSIONS_ITEM_DETAILS);
source->AddLocalizedString("itemReloadDone",
IDS_MD_EXTENSIONS_ITEM_RELOAD_DONE);
source->AddLocalizedString("itemErrors", IDS_MD_EXTENSIONS_ITEM_ERRORS);
source->AddLocalizedString("accessibilityErrorLine",
IDS_MD_EXTENSIONS_ACCESSIBILITY_ERROR_LINE);
......
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