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

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

Issue 1592513002: Use a predicate that isn't so granular during continuous read. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 var continueReading = function(prevRange) { 411 var continueReading = function(prevRange) {
412 if (!global.isReadingContinuously || !this.currentRange_) 412 if (!global.isReadingContinuously || !this.currentRange_)
413 return; 413 return;
414 414
415 new Output().withSpeechAndBraille( 415 new Output().withSpeechAndBraille(
416 this.currentRange_, prevRange, Output.EventType.NAVIGATE) 416 this.currentRange_, prevRange, Output.EventType.NAVIGATE)
417 .onSpeechEnd(function() { continueReading(prevRange); }) 417 .onSpeechEnd(function() { continueReading(prevRange); })
418 .go(); 418 .go();
419 prevRange = this.currentRange_; 419 prevRange = this.currentRange_;
420 this.setCurrentRange( 420 this.setCurrentRange(
421 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD)); 421 this.currentRange_.move(cursors.Unit.DOM_NODE, Dir.FORWARD));
422 422
423 if (!this.currentRange_ || this.currentRange_.equals(prevRange)) 423 if (!this.currentRange_ || this.currentRange_.equals(prevRange))
424 global.isReadingContinuously = false; 424 global.isReadingContinuously = false;
425 }.bind(this); 425 }.bind(this);
426 426
427 continueReading(null); 427 continueReading(null);
428 return false; 428 return false;
429 case 'showContextMenu': 429 case 'showContextMenu':
430 if (this.currentRange_) { 430 if (this.currentRange_) {
431 var actionNode = this.currentRange_.start.node; 431 var actionNode = this.currentRange_.start.node;
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 690 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
691 .replace(/\*/g, '.*') 691 .replace(/\*/g, '.*')
692 .replace(/\?/g, '.'); 692 .replace(/\?/g, '.');
693 }).join('|') + ')$'); 693 }).join('|') + ')$');
694 }; 694 };
695 695
696 /** @type {Background} */ 696 /** @type {Background} */
697 global.backgroundObj = new Background(); 697 global.backgroundObj = new Background();
698 698
699 }); // goog.scope 699 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698