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

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

Issue 845693004: Initial implementation of continuous read for ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove e2e test. Created 5 years, 11 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 | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | 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 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();
},
/**
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698