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

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

Issue 2957653002: Provide feedback for multi-line selections (Closed)
Patch Set: Add a test. Created 3 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_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/editing.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
index 4679dd3dee3af47bef5b8d50f1c0ca6dad864834..44ed5979c578bc788b84936b00580c5084f1b960 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -313,6 +313,11 @@ AutomationRichEditableText.prototype = {
new Range(cur.start_, cur.end_),
new Range(prev.start_, prev.end_), Output.EventType.NAVIGATE)
.go();
+ } else if (!cur.hasCollapsedSelection()) {
+ // This is a selection.
+ cvox.ChromeVox.tts.speak(cur.selectedText, cvox.QueueMode.CATEGORY_FLUSH);
+ cvox.ChromeVox.tts.speak(Msgs.getMsg('selected'), cvox.QueueMode.QUEUE);
+ this.brailleCurrentRichLine_();
} else {
// Describe the current line. This accounts for previous/current
// selections and picking the line edge boundary that changed (as computed
@@ -724,6 +729,16 @@ editing.EditableLine.prototype = {
return this.value_.toString();
},
+ /** @return {string} */
+ get selectedText() {
+ return this.value_.toString().substring(this.startOffset, this.endOffset);
+ },
+
+ /** @return {boolean} */
+ hasCollapsedSelection: function() {
+ return this.start_.equals(this.end_);
+ },
+
/**
* Returns true if |otherLine| surrounds the same line as |this|. Note that
* the contents of the line might be different.
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698