goog.require('cvox.AbstractEarcons');
goog.require('cvox.AbstractTts');
goog.require('cvox.BrailleInterface');
-goog.require('cvox.BrailleUtil');
goog.require('cvox.NavBraille');
this.earcons_ = earcons;
/** @type {function(string)} @private */
this.msg_ = cvox.ChromeVox.msgs.getMsg.bind(cvox.ChromeVox.msgs);
+ /**
+ * Tracks whether the active tab has finished loading.
+ * @type {boolean}
+ * @private
+ */
+ this.lastActiveTabLoaded_ = false;
chrome.tabs.onCreated.addListener(this.onCreated.bind(this));
chrome.tabs.onRemoved.addListener(this.onRemoved.bind(this));
return;
}
this.tts_.speak(this.msg_('chrome_tab_created'),
- cvox.AbstractTts.QUEUE_MODE_FLUSH,
+ cvox.QueueMode.FLUSH,
cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
this.braille_.write(
cvox.NavBraille.fromText(this.msg_('chrome_tab_created')));
return;
}
chrome.tabs.get(activeInfo.tabId, function(tab) {
+ this.lastActiveTabLoaded_ = tab.status == 'complete';
if (tab.status == 'loading') {
return;
}
var title = tab.title ? tab.title : tab.url;
this.tts_.speak(this.msg_('chrome_tab_selected',
[title]),
- cvox.AbstractTts.QUEUE_MODE_FLUSH,
+ cvox.QueueMode.FLUSH,
cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
this.braille_.write(
cvox.NavBraille.fromText(this.msg_('chrome_tab_selected', [title])));
return;
}
if (tab.status == 'loading') {
+ this.lastActiveTabLoaded_ = false;
this.earcons_.playEarcon(cvox.AbstractEarcons.BUSY_PROGRESS_LOOP);
- } else {
+ } else if (!this.lastActiveTabLoaded_) {
+ this.lastActiveTabLoaded_ = true;
this.earcons_.playEarcon(cvox.AbstractEarcons.TASK_SUCCESS);
}
}.bind(this));
'chrome_normal_window_selected';
var title = tab.title ? tab.title : tab.url;
this.tts_.speak(this.msg_(msgId, [title]),
- cvox.AbstractTts.QUEUE_MODE_FLUSH,
+ cvox.QueueMode.FLUSH,
cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
this.braille_.write(
cvox.NavBraille.fromText(this.msg_(msgId, [title])));