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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/editable_text.js

Issue 604423002: Use an enum for ChromeVox queue mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 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 goog.provide('cvox.ChromeVoxEditableContentEditable'); 5 goog.provide('cvox.ChromeVoxEditableContentEditable');
6 goog.provide('cvox.ChromeVoxEditableHTMLInput'); 6 goog.provide('cvox.ChromeVoxEditableHTMLInput');
7 goog.provide('cvox.ChromeVoxEditableTextArea'); 7 goog.provide('cvox.ChromeVoxEditableTextArea');
8 goog.provide('cvox.ChromeVoxEditableTextBase'); 8 goog.provide('cvox.ChromeVoxEditableTextBase');
9 goog.provide('cvox.TextChangeEvent'); 9 goog.provide('cvox.TextChangeEvent');
10 goog.provide('cvox.TextHandlerInterface'); 10 goog.provide('cvox.TextHandlerInterface');
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 * user action. 337 * user action.
338 * @param {Object=} opt_personality Personality used to speak text. 338 * @param {Object=} opt_personality Personality used to speak text.
339 */ 339 */
340 cvox.ChromeVoxEditableTextBase.prototype.speak = 340 cvox.ChromeVoxEditableTextBase.prototype.speak =
341 function(str, opt_triggeredByUser, opt_personality) { 341 function(str, opt_triggeredByUser, opt_personality) {
342 // If there is a node associated with the editable text object, 342 // If there is a node associated with the editable text object,
343 // make sure that node has focus before speaking it. 343 // make sure that node has focus before speaking it.
344 if (this.node && (document.activeElement != this.node)) { 344 if (this.node && (document.activeElement != this.node)) {
345 return; 345 return;
346 } 346 }
347 var queueMode = cvox.AbstractTts.QUEUE_MODE_QUEUE; 347 var queueMode = cvox.QueueMode.QUEUE;
348 if (opt_triggeredByUser === true) { 348 if (opt_triggeredByUser === true) {
349 queueMode = cvox.AbstractTts.QUEUE_MODE_FLUSH; 349 queueMode = cvox.QueueMode.FLUSH;
350 } 350 }
351 this.tts.speak(str, queueMode, opt_personality || {}); 351 this.tts.speak(str, queueMode, opt_personality || {});
352 }; 352 };
353 353
354 354
355 /** 355 /**
356 * Update the state of the text and selection and describe any changes as 356 * Update the state of the text and selection and describe any changes as
357 * appropriate. 357 * appropriate.
358 * 358 *
359 * @param {cvox.TextChangeEvent} evt The text change event. 359 * @param {cvox.TextChangeEvent} evt The text change event.
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 // but there is still content after the new line (like the example 1322 // but there is still content after the new line (like the example
1323 // above after "Title"). In these cases, we "pretend" we're the 1323 // above after "Title"). In these cases, we "pretend" we're the
1324 // last character so we speak "blank". 1324 // last character so we speak "blank".
1325 return false; 1325 return false;
1326 } 1326 }
1327 1327
1328 // Otherwise, we should never speak "blank" no matter what (even if 1328 // Otherwise, we should never speak "blank" no matter what (even if
1329 // we're at the end of a content editable). 1329 // we're at the end of a content editable).
1330 return true; 1330 return true;
1331 }; 1331 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698