| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Script that runs on the background page. | 6 * @fileoverview Script that runs on the background page. |
| 7 * | 7 * |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('cvox.ChromeVoxBackground'); | 10 goog.provide('cvox.ChromeVoxBackground'); |
| 11 | 11 |
| 12 goog.require('cvox.AbstractEarcons'); | 12 goog.require('cvox.AbstractEarcons'); |
| 13 goog.require('cvox.AccessibilityApiHandler'); | 13 goog.require('cvox.AccessibilityApiHandler'); |
| 14 goog.require('cvox.BrailleBackground'); | 14 goog.require('cvox.BrailleBackground'); |
| 15 goog.require('cvox.BrailleCaptionsBackground'); | 15 goog.require('cvox.BrailleCaptionsBackground'); |
| 16 goog.require('cvox.ChromeMsgs'); | |
| 17 goog.require('cvox.ChromeVox'); | 16 goog.require('cvox.ChromeVox'); |
| 18 goog.require('cvox.ChromeVoxEditableTextBase'); | 17 goog.require('cvox.ChromeVoxEditableTextBase'); |
| 19 goog.require('cvox.ChromeVoxPrefs'); | 18 goog.require('cvox.ChromeVoxPrefs'); |
| 20 goog.require('cvox.CompositeTts'); | 19 goog.require('cvox.CompositeTts'); |
| 21 goog.require('cvox.ConsoleTts'); | 20 goog.require('cvox.ConsoleTts'); |
| 22 goog.require('cvox.EarconsBackground'); | 21 goog.require('cvox.EarconsBackground'); |
| 23 goog.require('cvox.ExtensionBridge'); | 22 goog.require('cvox.ExtensionBridge'); |
| 24 goog.require('cvox.HostFactory'); | 23 goog.require('cvox.HostFactory'); |
| 25 goog.require('cvox.InjectedScriptLoader'); | 24 goog.require('cvox.InjectedScriptLoader'); |
| 25 goog.require('cvox.Msgs'); |
| 26 goog.require('cvox.NavBraille'); | 26 goog.require('cvox.NavBraille'); |
| 27 // TODO(dtseng): This is required to prevent Closure from stripping our export | 27 // TODO(dtseng): This is required to prevent Closure from stripping our export |
| 28 // prefs on window. | 28 // prefs on window. |
| 29 goog.require('cvox.OptionsPage'); | 29 goog.require('cvox.OptionsPage'); |
| 30 goog.require('cvox.PlatformFilter'); | 30 goog.require('cvox.PlatformFilter'); |
| 31 goog.require('cvox.PlatformUtil'); | 31 goog.require('cvox.PlatformUtil'); |
| 32 goog.require('cvox.TabsApiHandler'); | 32 goog.require('cvox.TabsApiHandler'); |
| 33 goog.require('cvox.TtsBackground'); | 33 goog.require('cvox.TtsBackground'); |
| 34 | 34 |
| 35 | 35 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 cvox.ChromeVoxBackground.prototype.init = function() { | 49 cvox.ChromeVoxBackground.prototype.init = function() { |
| 50 // In the case of ChromeOS, only continue initialization if this instance of | 50 // In the case of ChromeOS, only continue initialization if this instance of |
| 51 // ChromeVox is as we expect. This prevents ChromeVox from the webstore from | 51 // ChromeVox is as we expect. This prevents ChromeVox from the webstore from |
| 52 // running. | 52 // running. |
| 53 if (cvox.ChromeVox.isChromeOS && | 53 if (cvox.ChromeVox.isChromeOS && |
| 54 chrome.i18n.getMessage('@@extension_id') != | 54 chrome.i18n.getMessage('@@extension_id') != |
| 55 'mndnfokpggljbaajbnioimlmbfngpief') { | 55 'mndnfokpggljbaajbnioimlmbfngpief') { |
| 56 return; | 56 return; |
| 57 } | 57 } |
| 58 | 58 |
| 59 cvox.ChromeVox.msgs = cvox.HostFactory.getMsgs(); | 59 cvox.ChromeVox.msgs = new cvox.Msgs(); |
| 60 this.prefs = new cvox.ChromeVoxPrefs(); | 60 this.prefs = new cvox.ChromeVoxPrefs(); |
| 61 this.readPrefs(); | 61 this.readPrefs(); |
| 62 | 62 |
| 63 var consoleTts = cvox.ConsoleTts.getInstance(); | 63 var consoleTts = cvox.ConsoleTts.getInstance(); |
| 64 consoleTts.setEnabled(true); | 64 consoleTts.setEnabled(true); |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Chrome's actual TTS which knows and cares about pitch, volume, etc. | 67 * Chrome's actual TTS which knows and cares about pitch, volume, etc. |
| 68 * @type {cvox.TtsBackground} | 68 * @type {cvox.TtsBackground} |
| 69 * @private | 69 * @private |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 var background = new cvox.ChromeVoxBackground(); | 537 var background = new cvox.ChromeVoxBackground(); |
| 538 background.init(); | 538 background.init(); |
| 539 window['speak'] = goog.bind(background.tts.speak, background.tts); | 539 window['speak'] = goog.bind(background.tts.speak, background.tts); |
| 540 | 540 |
| 541 // Export the prefs object for access by the options page. | 541 // Export the prefs object for access by the options page. |
| 542 window['prefs'] = background.prefs; | 542 window['prefs'] = background.prefs; |
| 543 | 543 |
| 544 // Export the braille object for access by the options page. | 544 // Export the braille object for access by the options page. |
| 545 window['braille'] = cvox.ChromeVox.braille; | 545 window['braille'] = cvox.ChromeVox.braille; |
| 546 })(); | 546 })(); |
| OLD | NEW |