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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // 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 |
69 // are not within web content. | 69 // are not within web content. |
70 if (node.root.role == 'desktop' || | 70 if (node.root.role == 'desktop' || |
71 !prevRange || | 71 !prevRange || |
72 prevRange.start.node.root != node.root) | 72 prevRange.start.node.root != node.root) |
73 global.backgroundObj.refreshMode(node.root.docUrl || ''); | 73 global.backgroundObj.refreshMode(node.root.docUrl || ''); |
74 | 74 |
75 // Don't process nodes inside of web content if ChromeVox Next is inactive. | 75 // Don't process nodes inside of web content if ChromeVox Next is inactive. |
76 if (node.root.role != RoleType.desktop && | 76 if (node.root.role != RoleType.desktop && |
77 global.backgroundObj.mode === ChromeVoxMode.CLASSIC) { | 77 global.backgroundObj.mode === ChromeVoxMode.CLASSIC) { |
78 chrome.accessibilityPrivate.setFocusRing([]); | 78 if (cvox.ChromeVox.isChromeOS) |
| 79 chrome.accessibilityPrivate.setFocusRing([]); |
79 return; | 80 return; |
80 } | 81 } |
81 | 82 |
82 // Don't output if focused node hasn't changed. | 83 // Don't output if focused node hasn't changed. |
83 if (prevRange && | 84 if (prevRange && |
84 evt.type == 'focus' && | 85 evt.type == 'focus' && |
85 global.backgroundObj.currentRange.equals(prevRange)) | 86 global.backgroundObj.currentRange.equals(prevRange)) |
86 return; | 87 return; |
87 | 88 |
88 new Output().withSpeechAndBraille( | 89 new Output().withSpeechAndBraille( |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (cvox.ChromeVox.isMac) | 284 if (cvox.ChromeVox.isMac) |
284 return; | 285 return; |
285 chrome.automation.getDesktop(function(desktop) { | 286 chrome.automation.getDesktop(function(desktop) { |
286 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 287 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
287 }); | 288 }); |
288 }; | 289 }; |
289 | 290 |
290 DesktopAutomationHandler.init_(); | 291 DesktopAutomationHandler.init_(); |
291 | 292 |
292 }); // goog.scope | 293 }); // goog.scope |
OLD | NEW |