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 3ebbef26438f93980576fb62907ff962dd13f78c..2776b6f9f258bd456373611be8168bacd825b788 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
@@ -208,6 +208,28 @@ Background.prototype = { |
if (this.currentRange_) |
this.currentRange_.getStart().getNode().doDefault(); |
break; |
+ case 'continuousRead': |
+ global.isReadingContinuously = true; |
+ var continueReading = function(prevRange) { |
+ if (!global.isReadingContinuously) |
+ return; |
+ |
+ new Output().withSpeechAndBraille( |
+ this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
+ .onSpeechEnd(function() { continueReading(prevRange); }) |
+ .onSpeechInterrupted( |
+ function() { global.isReadingContinuously = false; }) |
+ .go(); |
+ prevRange = this.currentRange_; |
+ this.currentRange_ = |
+ this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD); |
+ |
+ if (this.currentRange_.equals(prevRange)) |
+ global.isReadingContinuously = false; |
+ }.bind(this); |
+ |
+ continueReading(null); |
+ return; |
} |
if (pred) { |
@@ -224,7 +246,9 @@ Background.prototype = { |
var prevRange = this.currentRange_; |
this.currentRange_ = current; |
- new Output(this.currentRange_, prevRange, Output.EventType.NAVIGATE); |
+ new Output().withSpeechAndBraille( |
+ this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
+ .go(); |
} |
}, |
@@ -245,7 +269,9 @@ Background.prototype = { |
if (node.root.role != chrome.automation.RoleType.desktop && !this.active_) |
return; |
- new Output(this.currentRange_, prevRange, evt.type); |
+ new Output().withSpeechAndBraille( |
+ this.currentRange_, prevRange, evt.type) |
+ .go(); |
}, |
/** |
@@ -265,7 +291,9 @@ Background.prototype = { |
this.currentRange_ = cursors.Range.fromNode(node); |
if (this.currentRange_) |
- new Output(this.currentRange_, null, evt.type); |
+ new Output().withSpeechAndBraille( |
+ this.currentRange_, null, evt.type) |
+ .go(); |
}, |
/** |
@@ -303,7 +331,9 @@ Background.prototype = { |
} |
this.editableTextHandler.changed(textChangeEvent); |
- new Output(this.currentRange_, null, evt.type, {braille: true}); |
+ new Output().withBraille( |
+ this.currentRange_, null, evt.type) |
+ .go(); |
}, |
/** |