| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 Handles automation from a desktop automation node. | 6 * @fileoverview Handles automation from a desktop automation node. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('DesktopAutomationHandler'); | 9 goog.provide('DesktopAutomationHandler'); |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 }, | 86 }, |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * Provides all feedback once ChromeVox's focus changes. | 89 * Provides all feedback once ChromeVox's focus changes. |
| 90 * @param {!AutomationEvent} evt | 90 * @param {!AutomationEvent} evt |
| 91 */ | 91 */ |
| 92 onEventDefault: function(evt) { | 92 onEventDefault: function(evt) { |
| 93 var node = evt.target; | 93 var node = evt.target; |
| 94 if (!node) | 94 if (!node) |
| 95 return; | 95 return; |
| 96 node = node.activeDescendant || node; |
| 96 | 97 |
| 97 var prevRange = ChromeVoxState.instance.currentRange; | 98 var prevRange = ChromeVoxState.instance.currentRange; |
| 98 | 99 |
| 99 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); | 100 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); |
| 100 | 101 |
| 101 // Check to see if we've crossed roots. Continue if we've crossed roots or | 102 // Check to see if we've crossed roots. Continue if we've crossed roots or |
| 102 // are not within web content. | 103 // are not within web content. |
| 103 if (node.root.role == RoleType.desktop || | 104 if (node.root.role == RoleType.desktop || |
| 104 !prevRange || | 105 !prevRange || |
| 105 prevRange.start.node.root != node.root) | 106 prevRange.start.node.root != node.root) |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 if (cvox.ChromeVox.isMac) | 413 if (cvox.ChromeVox.isMac) |
| 413 return; | 414 return; |
| 414 chrome.automation.getDesktop(function(desktop) { | 415 chrome.automation.getDesktop(function(desktop) { |
| 415 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 416 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
| 416 }); | 417 }); |
| 417 }; | 418 }; |
| 418 | 419 |
| 419 DesktopAutomationHandler.init_(); | 420 DesktopAutomationHandler.init_(); |
| 420 | 421 |
| 421 }); // goog.scope | 422 }); // goog.scope |
| OLD | NEW |