chromevox.js revision cedac228d2dd51db4b79ea1e72c7f249408ee061
19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Copyright 2014 The Chromium Authors. All rights reserved. 29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Use of this source code is governed by a BSD-style license that can be 39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// found in the LICENSE file. 49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @fileoverview Defines a global object. The initialization of this 79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * object happens in init.js. 89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * 99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.provide('cvox.ChromeVox'); 129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Forward declarations. 149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// TODO (stoarca): Put these in a separate file and pass that 159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// into the build system instead of having it here. This will allow 169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// us to group all of the forward declarations for each file without 179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// having them overwrite the mapping in deps.js 189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/abstract_host.js', 209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.AbstractHost'], 219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/tts_interface.js', 259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.TtsInterface'], 269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/braille_interface.js', 309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.BrailleInterface'], 319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/mathjax_interface.js', 359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.MathJaxInterface'], 369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/abstract_msgs.js', 409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.AbstractMsgs'], 419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../host/interface/abstract_earcons.js', 459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.AbstractEarcons'], 469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../chromevox/common/key_sequence.js', 509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.KeySequence'], 519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../chromevox/injected/navigation_manager.js', 559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.NavigationManager'], 569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallgoog.addDependency( 599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall '../chromevox/injected/serializer.js', 609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall ['cvox.Serializer'], 619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall []); 629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall// Constants 649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Constant for verbosity setting (cvox.ChromeVox.verbosity). 669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @const 679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {number} 689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.VERBOSITY_VERBOSE = 0; 709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Constant for verbosity setting (cvox.ChromeVox.verbosity). 729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @const 739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {number} 749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.VERBOSITY_BRIEF = 1; 769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @constructor 809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox = function() {}; 829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.AbstractHost} 859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.host = null; 879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.TtsInterface} 899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.tts; 919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.BrailleInterface} 939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.braille; 959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.MathJaxInterface} 979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.mathJax; 999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.AbstractMsgs} 1019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.msgs = null; 1039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 1059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.isActive = true; 1079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {?string} 1099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.version = null; 1119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.AbstractEarcons} 1139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.earcons = null; 1159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.NavigationManager} 1179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.navigationManager = null; 1199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {cvox.Serializer} 1219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.serializer = null; 1239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 1259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.isStickyOn = false; 1279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 1299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.keyPrefixOn = false; 1319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Verbosity setting. 1339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * See: cvox.VERBOSITY_VERBOSE and cvox.VERBOSITY_BRIEF 1349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {number} 1359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.verbosity = cvox.VERBOSITY_VERBOSE; 1379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {number} 1399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.typingEcho = 0; 1419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Echoing on key press events. 1439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {Object.<string, boolean>} 1449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.keyEcho = {}; 1469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {Object.<string, {x:number, y:number}>} 1489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.position = {}; 1509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 1529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.isChromeOS = navigator.userAgent.indexOf('CrOS') != -1; 1549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 1569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.isMac = navigator.platform.indexOf('Mac') != -1; 1589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {string} 1609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallif (cvox.ChromeVox.isChromeOS) 1629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.modKeyStr = 'Shift+Search'; 1639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallelse if (cvox.ChromeVox.isMac) 1649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.modKeyStr = 'Ctrl+Cmd'; 1659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallelse 1669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.modKeyStr = 'Shift+Alt'; 1679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * If any of these keys is pressed with the modifier key, we go in sequence mode 1699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * where the subsequent independent key downs (while modifier keys are down) 1709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * are a part of the same shortcut. This array is populated in 1719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable(). 1729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {!Array.<cvox.KeySequence>} 1739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.sequenceSwitchKeyCodes = []; 1759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** @type {Object.<string, boolean>} */ 1769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.visitedUrls = {}; 1779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1789682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * This function can be called before doing an operation that may trigger 1799682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * focus events and other events that would normally be announced. This 1809682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * tells the event manager that these events should be ignored, they're 1819682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * a result of another command that's already announced them. This is 1829682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * a temporary state that's automatically reverted after a few milliseconds, 1839682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * there's no way to explicitly "un-mark". 1849682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {Function} 1859682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1869682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.markInUserCommand = function() {}; 1879682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1889682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Synchronizes ChromeVox's internal cursor to the targetNode. 1899682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {Node} targetNode The node that ChromeVox should be synced to. 1909682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {boolean=} speakNode If true, speaks out the node. 1919682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {number=} opt_queueMode The queue mode to use for speaking. 1929682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 1939682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.syncToNode = function( 1949682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall targetNode, speakNode, opt_queueMode) {}; 1959682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 1969682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 1979682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Speaks the given node. 1989682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {Node} targetNode The node that ChromeVox should be synced to. 1999682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {number=} queueMode The queue mode to use for speaking. 2009682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {Object=} properties Speech properties to use for this utterance. 2019682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 2029682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.speakNode = function(targetNode, queueMode, properties) {}; 2039682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2049682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 2059682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Provide a way for modules that can't depend on cvox.ChromeVoxUserCommands 2069682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * to execute commands. 2079682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * 2089682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {string} commandName The command name as a string. 2099682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 2109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.executeUserCommand = function(commandName) {}; 2119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 2139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * True if the document body has aria-hidden='true' when we first load. 2149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * ChromeVox will disallow any navigation and not eat any keystrokes. 2159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @type {boolean} 2169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 2179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.entireDocumentIsHidden = false; 2189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 2209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Stores state variables in a provided object. 2219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * 2229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {Object} store The object. 2239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 2249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.storeOn = function(store) { 2259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall store['isStickyOn'] = cvox.ChromeVox.isStickyOn; 2269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.navigationManager.storeOn(store); 2279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}; 2289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 2299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/** 2309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * Updates the object with state variables from an earlier storeOn call. 2319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * 2329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall * @param {Object} store The object. 2339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall */ 2349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallcvox.ChromeVox.readFrom = function(store) { 2359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.isStickyOn = store['isStickyOn']; 2369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall cvox.ChromeVox.navigationManager.readFrom(store); 2379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall}; 2389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall