| OLD | NEW |
| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 if (opt_focus) { | 429 if (opt_focus) { |
| 430 // TODO(dtseng): Figure out what it means to focus a range. | 430 // TODO(dtseng): Figure out what it means to focus a range. |
| 431 var actionNode = range.start.node; | 431 var actionNode = range.start.node; |
| 432 if (actionNode.role == RoleType.inlineTextBox) | 432 if (actionNode.role == RoleType.inlineTextBox) |
| 433 actionNode = actionNode.parent; | 433 actionNode = actionNode.parent; |
| 434 | 434 |
| 435 // Iframes, when focused, causes the child webArea to fire focus event. | 435 // Iframes, when focused, causes the child webArea to fire focus event. |
| 436 // This can result in getting stuck when navigating backward. | 436 // This can result in getting stuck when navigating backward. |
| 437 if (actionNode.role != RoleType.iframe && !actionNode.state.focused && | 437 if (actionNode.role != RoleType.iframe && !actionNode.state.focused && |
| 438 !AutomationPredicate.structuralContainer(actionNode)) | 438 !AutomationPredicate.structuralContainer(actionNode)) { |
| 439 actionNode.focus(); | 439 if (actionNode.state.focusable) { |
| 440 actionNode.focus(); |
| 441 } else { |
| 442 actionNode.setSequentialFocusNavigationStartingPoint(); |
| 443 } |
| 444 } |
| 440 } | 445 } |
| 441 var prevRange = this.currentRange_; | 446 var prevRange = this.currentRange_; |
| 442 this.setCurrentRange(range); | 447 this.setCurrentRange(range); |
| 443 | 448 |
| 444 var o = new Output(); | 449 var o = new Output(); |
| 445 var selectedRange; | 450 var selectedRange; |
| 446 if (this.pageSel_ && | 451 if (this.pageSel_ && |
| 447 this.pageSel_.isValid() && | 452 this.pageSel_.isValid() && |
| 448 range.isValid()) { | 453 range.isValid()) { |
| 449 // Compute the direction of the endpoints of each range. | 454 // Compute the direction of the endpoints of each range. |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 return new RegExp('^(' + globs.map(function(glob) { | 774 return new RegExp('^(' + globs.map(function(glob) { |
| 770 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 775 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 771 .replace(/\*/g, '.*') | 776 .replace(/\*/g, '.*') |
| 772 .replace(/\?/g, '.'); | 777 .replace(/\?/g, '.'); |
| 773 }).join('|') + ')$'); | 778 }).join('|') + ')$'); |
| 774 }; | 779 }; |
| 775 | 780 |
| 776 new Background(); | 781 new Background(); |
| 777 | 782 |
| 778 }); // goog.scope | 783 }); // goog.scope |
| OLD | NEW |