Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js

Issue 2008773002: Begin using ChromeVox Next to read tab and window titles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bunch of tests. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
index 96062a3add222306888f509ceb1240ac302154d2..d084d5bc12fd3209d86ab37eff77dfc7d0a55659 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js
@@ -51,6 +51,11 @@ cvox.TabsApiHandler = function() {
this.pageLoadTabID_ = null;
};
+/**
+ * @type {boolean}
+ */
+cvox.TabsApiHandler.shouldOutputSpeechAndBraille = true;
+
cvox.TabsApiHandler.prototype = {
/**
* Handles chrome.tabs.onCreated.
@@ -60,11 +65,13 @@ cvox.TabsApiHandler.prototype = {
if (!cvox.ChromeVox.isActive) {
return;
}
- cvox.ChromeVox.tts.speak(this.msg_('chrome_tab_created'),
- cvox.QueueMode.FLUSH,
- cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
- cvox.ChromeVox.braille.write(
- cvox.NavBraille.fromText(this.msg_('chrome_tab_created')));
+ if (cvox.TabsApiHandler.shouldOutputSpeechAndBraille) {
+ cvox.ChromeVox.tts.speak(this.msg_('chrome_tab_created'),
+ cvox.QueueMode.FLUSH,
+ cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
+ cvox.ChromeVox.braille.write(
+ cvox.NavBraille.fromText(this.msg_('chrome_tab_created')));
+ }
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_OPEN);
this.refreshAutomationHandler_(tab.id);
},
@@ -97,13 +104,16 @@ cvox.TabsApiHandler.prototype = {
}
this.updateLoadingSoundsWhenTabFocusChanges_(activeInfo.tabId);
chrome.tabs.get(activeInfo.tabId, function(tab) {
- var title = tab.title ? tab.title : tab.url;
- cvox.ChromeVox.tts.speak(this.msg_('chrome_tab_selected',
- [title]),
- cvox.QueueMode.FLUSH,
- cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
- cvox.ChromeVox.braille.write(
- cvox.NavBraille.fromText(this.msg_('chrome_tab_selected', [title])));
+ if (cvox.TabsApiHandler.shouldOutputSpeechAndBraille) {
+ var title = tab.title ? tab.title : tab.url;
+ cvox.ChromeVox.tts.speak(this.msg_('chrome_tab_selected',
+ [title]),
+ cvox.QueueMode.FLUSH,
+ cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
+ cvox.ChromeVox.braille.write(
+ cvox.NavBraille.fromText(
+ this.msg_('chrome_tab_selected', [title])));
+ }
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_SELECT);
this.refreshAutomationHandler_(tab.id);
this.focusTab_(tab.id);
@@ -172,15 +182,17 @@ cvox.TabsApiHandler.prototype = {
if (tabs[0])
this.updateLoadingSoundsWhenTabFocusChanges_(tabs[0].id);
- var msgId = window.incognito ? 'chrome_incognito_window_selected' :
- 'chrome_normal_window_selected';
- var tab = tabs[0] || {};
- var title = tab.title ? tab.title : tab.url;
- cvox.ChromeVox.tts.speak(this.msg_(msgId, [title]),
- cvox.QueueMode.FLUSH,
- cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
- cvox.ChromeVox.braille.write(
- cvox.NavBraille.fromText(this.msg_(msgId, [title])));
+ if (cvox.TabsApiHandler.shouldOutputSpeechAndBraille) {
+ var msgId = window.incognito ? 'chrome_incognito_window_selected' :
+ 'chrome_normal_window_selected';
+ var tab = tabs[0] || {};
+ var title = tab.title ? tab.title : tab.url;
+ cvox.ChromeVox.tts.speak(this.msg_(msgId, [title]),
+ cvox.QueueMode.FLUSH,
+ cvox.AbstractTts.PERSONALITY_ANNOUNCEMENT);
+ cvox.ChromeVox.braille.write(
+ cvox.NavBraille.fromText(this.msg_(msgId, [title])));
+ }
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_SELECT);
this.refreshAutomationHandler_(tab.id);
this.focusTab_(tab.id);

Powered by Google App Engine
This is Rietveld 408576698