| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 if (opt_focus) { | 375 if (opt_focus) { |
| 376 // TODO(dtseng): Figure out what it means to focus a range. | 376 // TODO(dtseng): Figure out what it means to focus a range. |
| 377 var actionNode = range.start.node; | 377 var actionNode = range.start.node; |
| 378 if (actionNode.role == RoleType.inlineTextBox) | 378 if (actionNode.role == RoleType.inlineTextBox) |
| 379 actionNode = actionNode.parent; | 379 actionNode = actionNode.parent; |
| 380 | 380 |
| 381 // Iframes, when focused, causes the child webArea to fire focus event. | 381 // Iframes, when focused, causes the child webArea to fire focus event. |
| 382 // This can result in getting stuck when navigating backward. | 382 // This can result in getting stuck when navigating backward. |
| 383 if (actionNode.role != RoleType.iframe && !actionNode.state.focused && | 383 if (actionNode.role != RoleType.iframe && !actionNode.state.focused && |
| 384 !AutomationPredicate.container(actionNode)) | 384 !AutomationPredicate.structuralContainer(actionNode)) |
| 385 actionNode.focus(); | 385 actionNode.focus(); |
| 386 } | 386 } |
| 387 var prevRange = this.currentRange_; | 387 var prevRange = this.currentRange_; |
| 388 this.setCurrentRange(range); | 388 this.setCurrentRange(range); |
| 389 | 389 |
| 390 var o = new Output(); | 390 var o = new Output(); |
| 391 var selectedRange; | 391 var selectedRange; |
| 392 if (this.pageSel_ && | 392 if (this.pageSel_ && |
| 393 this.pageSel_.isValid() && | 393 this.pageSel_.isValid() && |
| 394 range.isValid()) { | 394 range.isValid()) { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 return new RegExp('^(' + globs.map(function(glob) { | 748 return new RegExp('^(' + globs.map(function(glob) { |
| 749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 750 .replace(/\*/g, '.*') | 750 .replace(/\*/g, '.*') |
| 751 .replace(/\?/g, '.'); | 751 .replace(/\?/g, '.'); |
| 752 }).join('|') + ')$'); | 752 }).join('|') + ')$'); |
| 753 }; | 753 }; |
| 754 | 754 |
| 755 new Background(); | 755 new Background(); |
| 756 | 756 |
| 757 }); // goog.scope | 757 }); // goog.scope |
| OLD | NEW |