| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Puts text on a braille display. | 6 * @fileoverview Puts text on a braille display. |
| 7 * | 7 * |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('cvox.BrailleDisplayManager'); | 10 goog.provide('cvox.BrailleDisplayManager'); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 var viewPort = this.panStrategy_.viewPort; | 193 var viewPort = this.panStrategy_.viewPort; |
| 194 var buf = this.displayedContent_.slice(viewPort.start, viewPort.end); | 194 var buf = this.displayedContent_.slice(viewPort.start, viewPort.end); |
| 195 if (this.realDisplayState_.available) { | 195 if (this.realDisplayState_.available) { |
| 196 chrome.brailleDisplayPrivate.writeDots(buf); | 196 chrome.brailleDisplayPrivate.writeDots(buf); |
| 197 } | 197 } |
| 198 if (cvox.BrailleCaptionsBackground.isEnabled()) { | 198 if (cvox.BrailleCaptionsBackground.isEnabled()) { |
| 199 var start = this.brailleToTextPosition_(viewPort.start); | 199 var start = this.brailleToTextPosition_(viewPort.start); |
| 200 var end = this.brailleToTextPosition_(viewPort.end); | 200 var end = this.brailleToTextPosition_(viewPort.end); |
| 201 cvox.BrailleCaptionsBackground.setContent( | 201 cvox.BrailleCaptionsBackground.setContent( |
| 202 this.content_.text.toString().substring(start, end), buf); | 202 this.content_.text.toString().substring(start, end), buf, |
| 203 this.brailleToText_); |
| 203 } | 204 } |
| 204 }; | 205 }; |
| 205 | 206 |
| 206 | 207 |
| 207 /** | 208 /** |
| 208 * @param {!cvox.NavBraille} newContent New display content. | 209 * @param {!cvox.NavBraille} newContent New display content. |
| 209 * @param {cvox.ExpandingBrailleTranslator.ExpansionType} newExpansionType | 210 * @param {cvox.ExpandingBrailleTranslator.ExpansionType} newExpansionType |
| 210 * How the value part of of the new content should be expanded | 211 * How the value part of of the new content should be expanded |
| 211 * with regards to contractions. | 212 * with regards to contractions. |
| 212 * @private | 213 * @private |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 */ | 387 */ |
| 387 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { | 388 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { |
| 388 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : | 389 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : |
| 389 new cvox.FixedPanStrategy(); | 390 new cvox.FixedPanStrategy(); |
| 390 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); | 391 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); |
| 391 newStrategy.setContent(this.translatedContent_, | 392 newStrategy.setContent(this.translatedContent_, |
| 392 this.panStrategy_.viewPort.start); | 393 this.panStrategy_.viewPort.start); |
| 393 this.panStrategy_ = newStrategy; | 394 this.panStrategy_ = newStrategy; |
| 394 this.refresh_(); | 395 this.refresh_(); |
| 395 }; | 396 }; |
| OLD | NEW |