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

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

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (node) 175 if (node)
176 current = cursors.Range.fromNode(node); 176 current = cursors.Range.fromNode(node);
177 break; 177 break;
178 case 'doDefault': 178 case 'doDefault':
179 if (this.currentRange_) 179 if (this.currentRange_)
180 this.currentRange_.getStart().getNode().doDefault(); 180 this.currentRange_.getStart().getNode().doDefault();
181 break; 181 break;
182 case 'continuousRead': 182 case 'continuousRead':
183 global.isReadingContinuously = true; 183 global.isReadingContinuously = true;
184 var continueReading = function(prevRange) { 184 var continueReading = function(prevRange) {
185 if (!global.isReadingContinuously) 185 if (!global.isReadingContinuously || !this.currentRange_)
186 return; 186 return;
187 187
188 new Output().withSpeechAndBraille( 188 new Output().withSpeechAndBraille(
189 this.currentRange_, prevRange, Output.EventType.NAVIGATE) 189 this.currentRange_, prevRange, Output.EventType.NAVIGATE)
190 .onSpeechEnd(function() { continueReading(prevRange); }) 190 .onSpeechEnd(function() { continueReading(prevRange); })
191 .go(); 191 .go();
192 prevRange = this.currentRange_; 192 prevRange = this.currentRange_;
193 this.currentRange_ = 193 this.currentRange_ =
194 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD); 194 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD);
195 195
196 if (this.currentRange_.equals(prevRange)) 196 if (!this.currentRange_ || this.currentRange_.equals(prevRange))
197 global.isReadingContinuously = false; 197 global.isReadingContinuously = false;
198 }.bind(this); 198 }.bind(this);
199 199
200 continueReading(null); 200 continueReading(null);
201 return; 201 return;
202 } 202 }
203 203
204 if (pred) { 204 if (pred) {
205 var node = AutomationUtil.findNextNode( 205 var node = AutomationUtil.findNextNode(
206 current.getBound(dir).getNode(), dir, pred); 206 current.getBound(dir).getNode(), dir, pred);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 }.bind(this)); 435 }.bind(this));
436 } 436 }
437 }.bind(this)); 437 }.bind(this));
438 } 438 }
439 }; 439 };
440 440
441 /** @type {Background} */ 441 /** @type {Background} */
442 global.backgroundObj = new Background(); 442 global.backgroundObj = new Background();
443 443
444 }); // goog.scope 444 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698