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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js

Issue 889593002: Refactorings to reduce dependencies in ChromeVox 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Readd missing dep and add a new one that should've been there already. Created 5 years, 10 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 Provides output services for ChromeVox. 6 * @fileoverview Provides output services for ChromeVox.
7 */ 7 */
8 8
9 goog.provide('Output'); 9 goog.provide('Output');
10 goog.provide('Output.EventType'); 10 goog.provide('Output.EventType');
11 11
12 goog.require('AutomationUtil.Dir'); 12 goog.require('AutomationUtil.Dir');
13 goog.require('cursors.Cursor'); 13 goog.require('cursors.Cursor');
14 goog.require('cursors.Range'); 14 goog.require('cursors.Range');
15 goog.require('cursors.Unit'); 15 goog.require('cursors.Unit');
16 goog.require('cvox.BrailleUtil.ValueSelectionSpan');
17 goog.require('cvox.BrailleUtil.ValueSpan');
18 goog.require('cvox.Spannable'); 16 goog.require('cvox.Spannable');
17 goog.require('cvox.ValueSelectionSpan');
18 goog.require('cvox.ValueSpan');
19 19
20 goog.scope(function() { 20 goog.scope(function() {
21 var Dir = AutomationUtil.Dir; 21 var Dir = AutomationUtil.Dir;
22 22
23 /** 23 /**
24 * An Output object formats a cursors.Range into speech, braille, or both 24 * An Output object formats a cursors.Range into speech, braille, or both
25 * representations. This is typically a cvox.Spannable. 25 * representations. This is typically a cvox.Spannable.
26 * 26 *
27 * The translation from Range to these output representations rely upon format 27 * The translation from Range to these output representations rely upon format
28 * rules which specify how to convert AutomationNode objects into annotated 28 * rules which specify how to convert AutomationNode objects into annotated
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 var startIndex = -1, endIndex = -1; 331 var startIndex = -1, endIndex = -1;
332 if (selSpan) { 332 if (selSpan) {
333 var valueStart = this.brailleBuffer_.getSpanStart(selSpan); 333 var valueStart = this.brailleBuffer_.getSpanStart(selSpan);
334 var valueEnd = this.brailleBuffer_.getSpanEnd(selSpan); 334 var valueEnd = this.brailleBuffer_.getSpanEnd(selSpan);
335 if (valueStart === undefined || valueEnd === undefined) { 335 if (valueStart === undefined || valueEnd === undefined) {
336 valueStart = -1; 336 valueStart = -1;
337 valueEnd = -1; 337 valueEnd = -1;
338 } else { 338 } else {
339 startIndex = valueStart + selSpan.startIndex; 339 startIndex = valueStart + selSpan.startIndex;
340 endIndex = valueStart + selSpan.endIndex; 340 endIndex = valueStart + selSpan.endIndex;
341 this.brailleBuffer_.setSpan(new cvox.BrailleUtil.ValueSpan(valueStart), 341 this.brailleBuffer_.setSpan(new cvox.ValueSpan(valueStart),
342 valueStart, valueEnd); 342 valueStart, valueEnd);
343 this.brailleBuffer_.setSpan(new cvox.BrailleUtil.ValueSelectionSpan(), 343 this.brailleBuffer_.setSpan(new cvox.ValueSelectionSpan(),
344 startIndex, endIndex); 344 startIndex, endIndex);
345 } 345 }
346 } 346 }
347 347
348 var output = new cvox.NavBraille({ 348 var output = new cvox.NavBraille({
349 text: this.brailleBuffer_, 349 text: this.brailleBuffer_,
350 startIndex: startIndex, 350 startIndex: startIndex,
351 endIndex: endIndex 351 endIndex: endIndex
352 }); 352 });
353 353
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 706 }
707 707
708 if (currentNode != root) 708 if (currentNode != root)
709 throw 'Unbalanced parenthesis.'; 709 throw 'Unbalanced parenthesis.';
710 710
711 return root; 711 return root;
712 } 712 }
713 }; 713 };
714 714
715 }); // goog.scope 715 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698