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

Unified Diff: chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js

Issue 2401393003: Add multiline braille support. (Closed)
Patch Set: Addressed review comments Created 4 years, 2 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
Index: chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js b/chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js
index 5f2039a212dfe04518e72764919125341fd32e40..8426844052ddc8034d9b50c443b1b2a3804c3b01 100644
--- a/chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js
+++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager.js
@@ -67,7 +67,8 @@ cvox.BrailleDisplayManager = function(translatorManager) {
* @type {!cvox.BrailleDisplayState}
* @private
*/
- this.displayState_ = {available: false, textCellCount: undefined};
+ this.displayState_ = {available: false, textRowCount: undefined,
+ textColumnCount: undefined};
/**
* State reported from the chrome api, reflecting a real hardware
* display.
@@ -157,7 +158,8 @@ cvox.BrailleDisplayManager.prototype.setCommandListener = function(func) {
*/
cvox.BrailleDisplayManager.prototype.refreshDisplayState_ = function(
newState) {
- var oldSize = this.displayState_.textCellCount || 0;
+ var oldSize = this.displayState_.textColumnCount *
+ this.displayState_.textRowCount || 0;
this.realDisplayState_ = newState;
if (newState.available) {
this.displayState_ = newState;
@@ -165,7 +167,8 @@ cvox.BrailleDisplayManager.prototype.refreshDisplayState_ = function(
this.displayState_ =
cvox.BrailleCaptionsBackground.getVirtualDisplayState();
}
- var newSize = this.displayState_.textCellCount || 0;
+ var newSize = this.displayState_.textColumnCount *
+ this.displayState_.textRowCount || 0;
if (oldSize != newSize) {
this.panStrategy_.setDisplaySize(newSize);
}
@@ -193,7 +196,7 @@ cvox.BrailleDisplayManager.prototype.refresh_ = function() {
var viewPort = this.panStrategy_.viewPort;
var buf = this.displayedContent_.slice(viewPort.start, viewPort.end);
if (this.realDisplayState_.available) {
- chrome.brailleDisplayPrivate.writeDots(buf);
+ chrome.brailleDisplayPrivate.writeDots(buf, buf.byteLength, 1);
}
if (cvox.BrailleCaptionsBackground.isEnabled()) {
var start = this.brailleToTextPosition_(viewPort.start);
@@ -387,7 +390,7 @@ cvox.BrailleDisplayManager.prototype.brailleToTextPosition_ =
cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) {
var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() :
new cvox.FixedPanStrategy();
- newStrategy.setDisplaySize(this.displayState_.textCellCount || 0);
+ newStrategy.setDisplaySize(this.displayState_.textColumnCount || 0);
newStrategy.setContent(this.translatedContent_,
this.panStrategy_.viewPort.start);
this.panStrategy_ = newStrategy;

Powered by Google App Engine
This is Rietveld 408576698