| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 willHandleEvent_: function(evt) { | 58 willHandleEvent_: function(evt) { |
| 59 return !cvox.ChromeVox.isActive; | 59 return !cvox.ChromeVox.isActive; |
| 60 }, | 60 }, |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Provides all feedback once ChromeVox's focus changes. | 63 * Provides all feedback once ChromeVox's focus changes. |
| 64 * @param {!AutomationEvent} evt | 64 * @param {!AutomationEvent} evt |
| 65 */ | 65 */ |
| 66 onEventDefault: function(evt) { | 66 onEventDefault: function(evt) { |
| 67 var node = evt.target; | 67 var node = evt.target; |
| 68 |
| 68 if (!node) | 69 if (!node) |
| 69 return; | 70 return; |
| 70 | 71 |
| 71 var prevRange = ChromeVoxState.instance.currentRange; | 72 var prevRange = ChromeVoxState.instance.currentRange; |
| 72 | 73 |
| 73 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); | 74 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); |
| 74 | 75 |
| 75 // Check to see if we've crossed roots. Continue if we've crossed roots or | 76 // Check to see if we've crossed roots. Continue if we've crossed roots or |
| 76 // are not within web content. | 77 // are not within web content. |
| 77 if (node.root.role == RoleType.desktop || | 78 if (node.root.role == RoleType.desktop || |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 if (cvox.ChromeVox.isMac) | 295 if (cvox.ChromeVox.isMac) |
| 295 return; | 296 return; |
| 296 chrome.automation.getDesktop(function(desktop) { | 297 chrome.automation.getDesktop(function(desktop) { |
| 297 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 298 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
| 298 }); | 299 }); |
| 299 }; | 300 }; |
| 300 | 301 |
| 301 DesktopAutomationHandler.init_(); | 302 DesktopAutomationHandler.init_(); |
| 302 | 303 |
| 303 }); // goog.scope | 304 }); // goog.scope |
| OLD | NEW |