Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
index 5f0462c36b16502ce8d27084da69a05970374179..de70bb0933d3863e6f588e316d0e0f3b574f34d3 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
@@ -208,6 +208,21 @@ Background.prototype = { |
(new PanelCommand(PanelCommandType.DISABLE_MENUS)).send(); |
} |
+ // If switching to Classic from any automation-API-based mode, |
+ // clear the focus ring. |
+ if (mode === ChromeVoxMode.CLASSIC && mode != this.mode_) { |
+ if (cvox.ChromeVox.isChromeOS) |
+ chrome.accessibilityPrivate.setFocusRing([]); |
+ } |
+ |
+ // If switching away from Classic to any automation-API-based mode, |
+ // update the range based on what's focused. |
+ if (this.mode_ === ChromeVoxMode.CLASSIC && mode != this.mode_) { |
+ var focus = chrome.automation.getFocus(); |
+ if (focus) |
+ this.setCurrentRange(cursors.Range.fromNode(focus)); |
+ } |
+ |
this.mode_ = mode; |
}, |
@@ -499,6 +514,11 @@ Background.prototype = { |
// Leaving unlocalized as 'next' isn't an official name. |
cvox.ChromeVox.tts.speak(isClassic ? |
'classic' : 'next', cvox.QueueMode.FLUSH, {doNotInterrupt: true}); |
+ |
+ // If the new mode is Classic, return now so we don't announce |
+ // anything more. |
+ if (newMode == ChromeVoxMode.CLASSIC) |
+ return false; |
break; |
case 'toggleStickyMode': |
cvox.ChromeVoxBackground.setPref('sticky', |