summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authormerkulova@chromium.org <merkulova@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-24 15:52:33 +0000
committermerkulova@chromium.org <merkulova@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-24 15:52:33 +0000
commita62e2c6d2e5fb23551837c1d3430fa2e5b105c6d (patch)
treed4c01fd91a5017ffd108680192c8f6300b4ab9df /ui/webui
parent4256dbb23c2a2c694cd85aab094e57dcdcd4e679 (diff)
downloadchromium_src-a62e2c6d2e5fb23551837c1d3430fa2e5b105c6d.zip
chromium_src-a62e2c6d2e5fb23551837c1d3430fa2e5b105c6d.tar.gz
chromium_src-a62e2c6d2e5fb23551837c1d3430fa2e5b105c6d.tar.bz2
EULA and other OOBE screens get spoken title for accessibility.
Screens affected: Sign-in, EULA, username creation for Locally managed user. Added spoken feedback for camera take/discard user image events. Corresponding strings changed. BUG=346810 Review URL: https://codereview.chromium.org/190423003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/js/util.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js
index 56e2d2d..8bf3059 100644
--- a/ui/webui/resources/js/util.js
+++ b/ui/webui/resources/js/util.js
@@ -21,6 +21,25 @@ function $(id) {
}
/**
+ * Add an accessible message to the page that will be announced to
+ * users who have spoken feedback on, but will be invisible to all
+ * other users. It's removed right away so it doesn't clutter the DOM.
+ * @param {string} msg The text to be pronounced.
+ */
+function announceAccessibleMessage(msg) {
+ var element = document.createElement('div');
+ element.setAttribute('aria-live', 'polite');
+ element.style.position = 'relative';
+ element.style.left = '-9999px';
+ element.style.height = '0px';
+ element.innerText = msg;
+ document.body.appendChild(element);
+ window.setTimeout(function() {
+ document.body.removeChild(element);
+ }, 0);
+}
+
+/**
* Calls chrome.send with a callback and restores the original afterwards.
* @param {string} name The name of the message to send.
* @param {!Array} params The parameters to send.