| 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 new Output().withSpeechAndBraille(range, null, evt.type).go(); | 473 new Output().withSpeechAndBraille(range, null, evt.type).go(); |
| 474 }, | 474 }, |
| 475 | 475 |
| 476 /** | 476 /** |
| 477 * Provides all feedback once a focus event fires. | 477 * Provides all feedback once a focus event fires. |
| 478 * @param {Object} evt | 478 * @param {Object} evt |
| 479 */ | 479 */ |
| 480 onFocus: function(evt) { | 480 onFocus: function(evt) { |
| 481 // Invalidate any previous editable text handler state. | 481 // Invalidate any previous editable text handler state. |
| 482 this.editableTextHandler = null; | 482 this.editableTextHandler_ = null; |
| 483 | 483 |
| 484 var node = evt.target; | 484 var node = evt.target; |
| 485 | 485 |
| 486 // It almost never makes sense to place focus directly on a rootWebArea. | 486 // It almost never makes sense to place focus directly on a rootWebArea. |
| 487 if (node.role == RoleType.rootWebArea) { | 487 if (node.role == RoleType.rootWebArea) { |
| 488 // Try to find a focusable descendant. | 488 // Try to find a focusable descendant. |
| 489 node = AutomationUtil.findNodePost(node, | 489 node = AutomationUtil.findNodePost(node, |
| 490 Dir.FORWARD, | 490 Dir.FORWARD, |
| 491 AutomationPredicate.focused) || node; | 491 AutomationPredicate.focused) || node; |
| 492 | 492 |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 node.state.protected, | 790 node.state.protected, |
| 791 cvox.ChromeVox.tts); | 791 cvox.ChromeVox.tts); |
| 792 } | 792 } |
| 793 } | 793 } |
| 794 }; | 794 }; |
| 795 | 795 |
| 796 /** @type {Background} */ | 796 /** @type {Background} */ |
| 797 global.backgroundObj = new Background(); | 797 global.backgroundObj = new Background(); |
| 798 | 798 |
| 799 }); // goog.scope | 799 }); // goog.scope |
| OLD | NEW |