diff options
author | kimwjdalsl <kimwjdalsl@gmail.com> | 2016-01-12 22:58:18 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-13 06:59:31 +0000 |
commit | 6b7e440510907933e2be59bbd93ffdcca988e5d5 (patch) | |
tree | 39648706567d2f6f386ff6749be3bf8f27b1e576 | |
parent | d381c137005a9f37ae93bb79b07ac5daf9a69b50 (diff) | |
download | chromium_src-6b7e440510907933e2be59bbd93ffdcca988e5d5.zip chromium_src-6b7e440510907933e2be59bbd93ffdcca988e5d5.tar.gz chromium_src-6b7e440510907933e2be59bbd93ffdcca988e5d5.tar.bz2 |
Support alt text for Extension error icons
The extension error icons (which convey the severity of the issue) have no alt text.
so a person using a screen reader won't be able to differentiate the error severity.
BUG=476174
Review URL: https://codereview.chromium.org/1552353003
Cr-Commit-Position: refs/heads/master@{#369114}
-rw-r--r-- | chrome/app/generated_resources.grd | 9 | ||||
-rw-r--r-- | chrome/browser/resources/extensions/extension_error.js | 7 | ||||
-rw-r--r-- | chrome/browser/ui/webui/extensions/extension_settings_handler.cc | 7 |
3 files changed, 20 insertions, 3 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 9d66217..73275c9 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -4451,6 +4451,15 @@ Even if you have downloaded files from this website before, the website might ha <message name="IDS_EXTENSIONS_SHOW_BUTTON" desc="The text for the Show link."> Show button </message> + <message name="IDS_EXTENSIONS_LOG_LEVEL_INFO" desc="Alt-text indicating a low severity level for the error icon in the chrome://extensions page."> + Log + </message> + <message name="IDS_EXTENSIONS_LOG_LEVEL_WARN" desc="Alt-text indicating a medium severity level for the error icon in the chrome://extensions page."> + Warning + </message> + <message name="IDS_EXTENSIONS_LOG_LEVEL_ERROR" desc="Alt-text indicating a high severity level for the error icon in the chrome://extensions page."> + Error + </message> <message name="IDS_MD_EXTENSIONS_ITEM_ID" desc="The text for the label next to the extension id."> <span>ID:</span><ph name="EXTENSION_ID">$1<ex>cfhdojbkjhnklbpkdaibdccddilifddb</ex></ph> </message> diff --git a/chrome/browser/resources/extensions/extension_error.js b/chrome/browser/resources/extensions/extension_error.js index 0f50425..7853a15 100644 --- a/chrome/browser/resources/extensions/extension_error.js +++ b/chrome/browser/resources/extensions/extension_error.js @@ -67,18 +67,21 @@ cr.define('extensions', function() { * @type {(ManifestError|RuntimeError)} */ this.error = error; + var iconAltTextKey = 'extensionLogLevelWarn'; // Add an additional class for the severity level. if (error.type == chrome.developerPrivate.ErrorType.RUNTIME) { switch (error.severity) { case chrome.developerPrivate.ErrorLevel.LOG: this.classList.add('extension-error-severity-info'); + iconAltTextKey = 'extensionLogLevelInfo'; break; case chrome.developerPrivate.ErrorLevel.WARN: this.classList.add('extension-error-severity-warning'); break; case chrome.developerPrivate.ErrorLevel.ERROR: this.classList.add('extension-error-severity-fatal'); + iconAltTextKey = 'extensionLogLevelError'; break; default: assertNotReached(); @@ -90,9 +93,7 @@ cr.define('extensions', function() { var iconNode = document.createElement('img'); iconNode.className = 'extension-error-icon'; - // TODO(hcarmona): Populate alt text with a proper description since this - // icon conveys the severity of the error. (info, warning, fatal). - iconNode.alt = ''; + iconNode.alt = loadTimeData.getString(iconAltTextKey); this.insertBefore(iconNode, this.firstChild); var messageSpan = this.querySelector('.extension-error-message'); diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 5fdbfd2..3203c31 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -193,6 +193,13 @@ void ExtensionSettingsHandler::GetLocalizedValues( l10n_util::GetStringUTF16( IDS_EXTENSIONS_DISABLED_UPDATE_REQUIRED_BY_POLICY)); + source->AddLocalizedString("extensionLogLevelInfo", + IDS_EXTENSIONS_LOG_LEVEL_INFO); + source->AddLocalizedString("extensionLogLevelWarn", + IDS_EXTENSIONS_LOG_LEVEL_WARN); + source->AddLocalizedString("extensionLogLevelError", + IDS_EXTENSIONS_LOG_LEVEL_ERROR); + // TODO(estade): comb through the above strings to find ones no longer used in // uber extensions. source->AddString("extensionUninstall", |