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 Accesses Chrome's tabs extension API and gives | 6 * @fileoverview Accesses Chrome's tabs extension API and gives |
7 * feedback for events that happen in the "Chrome of Chrome". | 7 * feedback for events that happen in the "Chrome of Chrome". |
8 */ | 8 */ |
9 | 9 |
10 goog.provide('cvox.TabsApiHandler'); | 10 goog.provide('cvox.TabsApiHandler'); |
(...skipping 14 matching lines...) Expand all Loading... |
25 * @param {cvox.AbstractEarcons} earcons The earcons object to use for playing | 25 * @param {cvox.AbstractEarcons} earcons The earcons object to use for playing |
26 * earcons. | 26 * earcons. |
27 */ | 27 */ |
28 cvox.TabsApiHandler = function(tts, braille, earcons) { | 28 cvox.TabsApiHandler = function(tts, braille, earcons) { |
29 /** @type {cvox.TtsInterface} @private */ | 29 /** @type {cvox.TtsInterface} @private */ |
30 this.tts_ = tts; | 30 this.tts_ = tts; |
31 /** @type {cvox.BrailleInterface} @private */ | 31 /** @type {cvox.BrailleInterface} @private */ |
32 this.braille_ = braille; | 32 this.braille_ = braille; |
33 /** @type {cvox.AbstractEarcons} @private */ | 33 /** @type {cvox.AbstractEarcons} @private */ |
34 this.earcons_ = earcons; | 34 this.earcons_ = earcons; |
35 /** @type {function(string)} @private */ | 35 /** @type {function(string, Array<string>=)} @private */ |
36 this.msg_ = cvox.ChromeVox.msgs.getMsg.bind(cvox.ChromeVox.msgs); | 36 this.msg_ = cvox.ChromeVox.msgs.getMsg.bind(cvox.ChromeVox.msgs); |
37 /** | 37 /** |
38 * Tracks whether the active tab has finished loading. | 38 * Tracks whether the active tab has finished loading. |
39 * @type {boolean} | 39 * @type {boolean} |
40 * @private | 40 * @private |
41 */ | 41 */ |
42 this.lastActiveTabLoaded_ = false; | 42 this.lastActiveTabLoaded_ = false; |
43 | 43 |
44 chrome.tabs.onCreated.addListener(this.onCreated.bind(this)); | 44 chrome.tabs.onCreated.addListener(this.onCreated.bind(this)); |
45 chrome.tabs.onRemoved.addListener(this.onRemoved.bind(this)); | 45 chrome.tabs.onRemoved.addListener(this.onRemoved.bind(this)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 this.tts_.speak(this.msg_(msgId, [title]), | 142 this.tts_.speak(this.msg_(msgId, [title]), |
143 cvox.QueueMode.FLUSH, | 143 cvox.QueueMode.FLUSH, |
144 cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT); | 144 cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT); |
145 this.braille_.write( | 145 this.braille_.write( |
146 cvox.NavBraille.fromText(this.msg_(msgId, [title]))); | 146 cvox.NavBraille.fromText(this.msg_(msgId, [title]))); |
147 this.earcons_.playEarcon(cvox.AbstractEarcons.OBJECT_SELECT); | 147 this.earcons_.playEarcon(cvox.AbstractEarcons.OBJECT_SELECT); |
148 }.bind(this)); | 148 }.bind(this)); |
149 }.bind(this)); | 149 }.bind(this)); |
150 } | 150 } |
151 }; | 151 }; |
OLD | NEW |