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

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

Issue 1342933004: ChromeVox shouldn't update its active range for an alert event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jdonnelly
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 98cc4578abf5dd36e763d6b6e21916a269e6b04f..832456dd48f54ae4229dfbfff2960da67f46c364 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -78,7 +78,7 @@ Background = function() {
* @type {!Object<EventType, function(Object) : void>}
*/
this.listeners_ = {
- alert: this.onEventDefault,
+ alert: this.onAlert,
focus: this.onFocus,
hover: this.onEventDefault,
loadComplete: this.onLoadComplete,
@@ -454,6 +454,26 @@ Background.prototype = {
},
/**
+ * Makes an announcement without changing focus.
+ * @param {Object} evt
+ */
+ onAlert: function(evt) {
+ var node = evt.target;
+ if (!node)
+ return;
+
+ // Don't process nodes inside of web content if ChromeVox Next is inactive.
+ if (node.root.role != RoleType.desktop &&
+ this.mode_ === ChromeVoxMode.CLASSIC) {
+ return;
+ }
+
+ var range = cursors.Range.fromNode(node);
+
+ new Output().withSpeechAndBraille(range, null, evt.type).go();
+ },
+
+ /**
* Provides all feedback once a focus event fires.
* @param {Object} evt
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698