| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 willHandleEvent_: function(evt) { | 51 willHandleEvent_: function(evt) { |
| 52 return !cvox.ChromeVox.isActive; | 52 return !cvox.ChromeVox.isActive; |
| 53 }, | 53 }, |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Provides all feedback once ChromeVox's focus changes. | 56 * Provides all feedback once ChromeVox's focus changes. |
| 57 * @param {!AutomationEvent} evt | 57 * @param {!AutomationEvent} evt |
| 58 */ | 58 */ |
| 59 onEventDefault: function(evt) { | 59 onEventDefault: function(evt) { |
| 60 var node = evt.target; | 60 var node = evt.target; |
| 61 | |
| 62 if (!node) | 61 if (!node) |
| 63 return; | 62 return; |
| 64 | 63 |
| 65 var prevRange = ChromeVoxState.instance.currentRange; | 64 var prevRange = ChromeVoxState.instance.currentRange; |
| 66 | 65 |
| 67 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); | 66 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); |
| 68 | 67 |
| 69 // Check to see if we've crossed roots. Continue if we've crossed roots or | 68 // Check to see if we've crossed roots. Continue if we've crossed roots or |
| 70 // are not within web content. | 69 // are not within web content. |
| 71 if (node.root.role == RoleType.desktop || | 70 if (node.root.role == RoleType.desktop || |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 if (cvox.ChromeVox.isMac) | 277 if (cvox.ChromeVox.isMac) |
| 279 return; | 278 return; |
| 280 chrome.automation.getDesktop(function(desktop) { | 279 chrome.automation.getDesktop(function(desktop) { |
| 281 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 280 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
| 282 }); | 281 }); |
| 283 }; | 282 }; |
| 284 | 283 |
| 285 DesktopAutomationHandler.init_(); | 284 DesktopAutomationHandler.init_(); |
| 286 | 285 |
| 287 }); // goog.scope | 286 }); // goog.scope |
| OLD | NEW |