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. |