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

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

Issue 1814633002: Restore focus when an automation node becomes invalidated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return this.currentRange_; 273 return this.currentRange_;
274 }, 274 },
275 275
276 /** 276 /**
277 * @override 277 * @override
278 */ 278 */
279 setCurrentRange: function(newRange) { 279 setCurrentRange: function(newRange) {
280 if (!newRange) 280 if (!newRange)
281 return; 281 return;
282 282
283 // Is the range invalid?
284 if (newRange.start.node.role === undefined ||
dmazzoni 2016/03/16 23:48:36 Consider ending an excursion if necessary?
David Tseng 2016/03/17 00:40:11 I don't think we want this. For example, in an inc
285 newRange.end.node.role === undefined) {
286 // Restore range to the focused location.
287 chrome.automation.getFocus(function(f) {
288 newRange = cursors.Range.fromNode(f);
289 });
290 }
291
283 if (!this.inExcursion_) 292 if (!this.inExcursion_)
284 this.savedRange_ = new cursors.Range(newRange.start, newRange.end); 293 this.savedRange_ = new cursors.Range(newRange.start, newRange.end);
285 294
286 this.currentRange_ = newRange; 295 this.currentRange_ = newRange;
287 296
288 if (this.currentRange_) 297 if (this.currentRange_)
289 this.currentRange_.start.node.makeVisible(); 298 this.currentRange_.start.node.makeVisible();
290 }, 299 },
291 300
292 /** Forces ChromeVox Next to be active for all tabs. */ 301 /** Forces ChromeVox Next to be active for all tabs. */
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 1005 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
997 .replace(/\*/g, '.*') 1006 .replace(/\*/g, '.*')
998 .replace(/\?/g, '.'); 1007 .replace(/\?/g, '.');
999 }).join('|') + ')$'); 1008 }).join('|') + ')$');
1000 }; 1009 };
1001 1010
1002 /** @type {Background} */ 1011 /** @type {Background} */
1003 global.backgroundObj = new Background(); 1012 global.backgroundObj = new Background();
1004 1013
1005 }); // goog.scope 1014 }); // 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