| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview An interface for querying and modifying the global | 6 * @fileoverview An interface for querying and modifying the global |
| 7 * ChromeVox state, to avoid direct dependencies on the Background | 7 * ChromeVox state, to avoid direct dependencies on the Background |
| 8 * object and to facilitate mocking for tests. | 8 * object and to facilitate mocking for tests. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if (ChromeVoxState.instance) | 32 if (ChromeVoxState.instance) |
| 33 throw 'Trying to create two instances of singleton ChromeVoxState.'; | 33 throw 'Trying to create two instances of singleton ChromeVoxState.'; |
| 34 ChromeVoxState.instance = this; | 34 ChromeVoxState.instance = this; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * @type {ChromeVoxState} | 38 * @type {ChromeVoxState} |
| 39 */ | 39 */ |
| 40 ChromeVoxState.instance; | 40 ChromeVoxState.instance; |
| 41 | 41 |
| 42 /** | |
| 43 * Holds the un-composite tts object. | |
| 44 * @type {Object} | |
| 45 */ | |
| 46 ChromeVoxState.backgroundTts; | |
| 47 | |
| 48 /** | |
| 49 * @type {boolean} | |
| 50 */ | |
| 51 ChromeVoxState.isReadingContinuously; | |
| 52 | |
| 53 ChromeVoxState.prototype = { | 42 ChromeVoxState.prototype = { |
| 54 /** @type {ChromeVoxMode} */ | 43 /** @type {ChromeVoxMode} */ |
| 55 get mode() { | 44 get mode() { |
| 56 return this.getMode(); | 45 return this.getMode(); |
| 57 }, | 46 }, |
| 58 | 47 |
| 59 /** | 48 /** |
| 60 * @return {ChromeVoxMode} The current mode. | 49 * @return {ChromeVoxMode} The current mode. |
| 61 * @protected | 50 * @protected |
| 62 */ | 51 */ |
| 63 getMode: function() { | 52 getMode: function() { |
| 64 return ChromeVoxMode.NEXT; | 53 return ChromeVoxMode.NEXT; |
| 65 }, | 54 }, |
| 66 | 55 |
| 56 /** |
| 57 * Sets the current ChromeVox mode. |
| 58 * @param {ChromeVoxMode} mode |
| 59 * @param {boolean=} opt_injectClassic Injects ChromeVox classic into tabs; |
| 60 * defaults to false. |
| 61 */ |
| 62 setMode: goog.abstractMethod, |
| 63 |
| 64 /** |
| 65 * Refreshes the current mode based on a node. |
| 66 * @param {!chrome.automation.AutomationNode} url |
| 67 */ |
| 68 refreshMode: goog.abstractMethod, |
| 69 |
| 67 /** @type {cursors.Range} */ | 70 /** @type {cursors.Range} */ |
| 68 get currentRange() { | 71 get currentRange() { |
| 69 return this.getCurrentRange(); | 72 return this.getCurrentRange(); |
| 70 }, | 73 }, |
| 71 | 74 |
| 72 /** | 75 /** |
| 73 * @return {cursors.Range} The current range. | 76 * @return {cursors.Range} The current range. |
| 74 * @protected | 77 * @protected |
| 75 */ | 78 */ |
| 76 getCurrentRange: function() { | 79 getCurrentRange: function() { |
| 77 return null; | 80 return null; |
| 78 }, | 81 }, |
| 79 | 82 |
| 80 /** | 83 /** |
| 81 * @param {cursors.Range} newRange The new range. | 84 * @param {cursors.Range} newRange The new range. |
| 82 */ | 85 */ |
| 83 setCurrentRange: goog.abstractMethod, | 86 setCurrentRange: goog.abstractMethod, |
| 84 }; | 87 }; |
| OLD | NEW |