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

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

Issue 2957653002: Provide feedback for multi-line selections (Closed)
Patch Set: Clarity check. 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 | 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/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 e6f234cd0f05182c43750238295ea3f60a942d0e..99b1dc085ca8650667393f28c604402b9dc92f5b 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);
dmazzoni 2017/06/23 19:50:49 Do you want to do this if there's a lot of selecte
David Tseng 2017/06/23 20:06:09 I think this is ok since |cur| will be at most a l
+ 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
@@ -741,6 +746,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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698