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

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

Issue 1282593002: Add ChromeVox panel and implement caption display functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to accessibility_manager in this change Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 /** @private */ 188 /** @private */
189 cvox.BrailleDisplayManager.prototype.refresh_ = function() { 189 cvox.BrailleDisplayManager.prototype.refresh_ = function() {
190 if (!this.displayState_.available) { 190 if (!this.displayState_.available) {
191 return; 191 return;
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
199 var start = this.brailleToTextPosition_(viewPort.start);
200 var end = this.brailleToTextPosition_(viewPort.end);
201 var brailleText = this.content_.text.toString().substring(start, end);
198 if (cvox.BrailleCaptionsBackground.isEnabled()) { 202 if (cvox.BrailleCaptionsBackground.isEnabled()) {
199 var start = this.brailleToTextPosition_(viewPort.start); 203 cvox.BrailleCaptionsBackground.setContent(brailleText, buf);
200 var end = this.brailleToTextPosition_(viewPort.end);
201 cvox.BrailleCaptionsBackground.setContent(
202 this.content_.text.toString().substring(start, end), buf);
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
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 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/BUILD.gn ('k') | chrome/browser/resources/chromeos/chromevox/chromevox.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698