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 | |
69 if (!node) | 68 if (!node) |
70 return; | 69 return; |
71 | 70 |
72 var prevRange = ChromeVoxState.instance.currentRange; | 71 var prevRange = ChromeVoxState.instance.currentRange; |
73 | 72 |
74 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); | 73 ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node)); |
75 | 74 |
76 // Check to see if we've crossed roots. Continue if we've crossed roots or | 75 // Check to see if we've crossed roots. Continue if we've crossed roots or |
77 // are not within web content. | 76 // are not within web content. |
78 if (node.root.role == RoleType.desktop || | 77 if (node.root.role == RoleType.desktop || |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (cvox.ChromeVox.isMac) | 294 if (cvox.ChromeVox.isMac) |
296 return; | 295 return; |
297 chrome.automation.getDesktop(function(desktop) { | 296 chrome.automation.getDesktop(function(desktop) { |
298 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 297 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
299 }); | 298 }); |
300 }; | 299 }; |
301 | 300 |
302 DesktopAutomationHandler.init_(); | 301 DesktopAutomationHandler.init_(); |
303 | 302 |
304 }); // goog.scope | 303 }); // goog.scope |
OLD | NEW |