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

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

Issue 955643006: Allows endCallbacks in tts to queue up speech in the speech queue and simplify speech output logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 The entry point for all ChromeVox2 related code for the 6 * @fileoverview The entry point for all ChromeVox2 related code for the
7 * background page. 7 * background page.
8 */ 8 */
9 9
10 goog.provide('Background'); 10 goog.provide('Background');
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 break; 178 break;
179 case 'continuousRead': 179 case 'continuousRead':
180 global.isReadingContinuously = true; 180 global.isReadingContinuously = true;
181 var continueReading = function(prevRange) { 181 var continueReading = function(prevRange) {
182 if (!global.isReadingContinuously) 182 if (!global.isReadingContinuously)
183 return; 183 return;
184 184
185 new Output().withSpeechAndBraille( 185 new Output().withSpeechAndBraille(
186 this.currentRange_, prevRange, Output.EventType.NAVIGATE) 186 this.currentRange_, prevRange, Output.EventType.NAVIGATE)
187 .onSpeechEnd(function() { continueReading(prevRange); }) 187 .onSpeechEnd(function() { continueReading(prevRange); })
188 .onSpeechInterrupted(
189 function() { global.isReadingContinuously = false; })
190 .go(); 188 .go();
191 prevRange = this.currentRange_; 189 prevRange = this.currentRange_;
192 this.currentRange_ = 190 this.currentRange_ =
193 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD); 191 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD);
194 192
195 if (this.currentRange_.equals(prevRange)) 193 if (this.currentRange_.equals(prevRange))
196 global.isReadingContinuously = false; 194 global.isReadingContinuously = false;
197 }.bind(this); 195 }.bind(this);
198 196
199 continueReading(null); 197 continueReading(null);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 }.bind(this)); 371 }.bind(this));
374 } 372 }
375 }.bind(this)); 373 }.bind(this));
376 } 374 }
377 }; 375 };
378 376
379 /** @type {Background} */ 377 /** @type {Background} */
380 global.backgroundObj = new Background(); 378 global.backgroundObj = new Background();
381 379
382 }); // goog.scope 380 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698