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

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

Issue 2104663003: Prepare ChromeVox for webstore release. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix key maps. Created 4 years, 6 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 000462fae0ec2537cb5b89818711ef42f277bddd..c2846f8a44938d5365d46e20161305d0636d86e2 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
@@ -9,6 +9,7 @@
goog.provide('cvox.TabsApiHandler');
+goog.require('Stubs');
goog.require('TabsAutomationHandler');
goog.require('cvox.AbstractEarcons');
goog.require('cvox.AbstractTts');
@@ -118,7 +119,6 @@ cvox.TabsApiHandler.prototype = {
}
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_SELECT);
this.refreshAutomationHandler_(tab.id);
- this.focusTab_(tab.id);
}.bind(this));
},
@@ -184,10 +184,10 @@ cvox.TabsApiHandler.prototype = {
if (tabs[0])
this.updateLoadingSoundsWhenTabFocusChanges_(tabs[0].id);
+ var tab = tabs[0] || {};
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,
@@ -197,7 +197,6 @@ cvox.TabsApiHandler.prototype = {
}
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.OBJECT_SELECT);
this.refreshAutomationHandler_(tab.id);
- this.focusTab_(tab.id);
}.bind(this));
}.bind(this));
},
@@ -208,7 +207,8 @@ cvox.TabsApiHandler.prototype = {
* @private
*/
refreshAutomationHandler_: function(tabId) {
- if (!cvox.ChromeVox.isMac)
+ if (!cvox.ChromeVox.isMac ||
+ ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC)
return;
chrome.automation.getTree(tabId, function(node) {
@@ -220,19 +220,6 @@ cvox.TabsApiHandler.prototype = {
},
/**
- * @param {number} id Tab id to focus.
- * @private
- */
- focusTab_: function(id) {
- chrome.automation.getTree(id, function(tab) {
- if (!tab)
- return;
-
- ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(tab));
- });
- },
-
- /**
* The chrome.tabs API doesn't always fire an onUpdated event when a
* page finishes loading, so we poll it.
* @param {number} tabId The id of the tab to monitor.

Powered by Google App Engine
This is Rietveld 408576698