| 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 |
| 42 ChromeVoxState.prototype = { | 53 ChromeVoxState.prototype = { |
| 43 /** @type {ChromeVoxMode} */ | 54 /** @type {ChromeVoxMode} */ |
| 44 get mode() { | 55 get mode() { |
| 45 return this.getMode(); | 56 return this.getMode(); |
| 46 }, | 57 }, |
| 47 | 58 |
| 48 /** | 59 /** |
| 49 * @return {ChromeVoxMode} The current mode. | 60 * @return {ChromeVoxMode} The current mode. |
| 50 * @protected | 61 * @protected |
| 51 */ | 62 */ |
| 52 getMode: function() { | 63 getMode: function() { |
| 53 return ChromeVoxMode.NEXT; | 64 return ChromeVoxMode.NEXT; |
| 54 }, | 65 }, |
| 55 | 66 |
| 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 | |
| 70 /** @type {cursors.Range} */ | 67 /** @type {cursors.Range} */ |
| 71 get currentRange() { | 68 get currentRange() { |
| 72 return this.getCurrentRange(); | 69 return this.getCurrentRange(); |
| 73 }, | 70 }, |
| 74 | 71 |
| 75 /** | 72 /** |
| 76 * @return {cursors.Range} The current range. | 73 * @return {cursors.Range} The current range. |
| 77 * @protected | 74 * @protected |
| 78 */ | 75 */ |
| 79 getCurrentRange: function() { | 76 getCurrentRange: function() { |
| 80 return null; | 77 return null; |
| 81 }, | 78 }, |
| 82 | 79 |
| 83 /** | 80 /** |
| 84 * @param {cursors.Range} newRange The new range. | 81 * @param {cursors.Range} newRange The new range. |
| 85 */ | 82 */ |
| 86 setCurrentRange: goog.abstractMethod, | 83 setCurrentRange: goog.abstractMethod, |
| 87 }; | 84 }; |
| OLD | NEW |