| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 /** | 230 /** |
| 231 * Provides all feedback once a value changed event fires. | 231 * Provides all feedback once a value changed event fires. |
| 232 * @param {Object} evt | 232 * @param {Object} evt |
| 233 */ | 233 */ |
| 234 onValueChanged: function(evt) { | 234 onValueChanged: function(evt) { |
| 235 // Don't process nodes inside of web content if ChromeVox Next is inactive. | 235 // Don't process nodes inside of web content if ChromeVox Next is inactive. |
| 236 if (evt.target.root.role != RoleType.desktop && | 236 if (evt.target.root.role != RoleType.desktop && |
| 237 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) | 237 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) |
| 238 return; | 238 return; |
| 239 | 239 |
| 240 if (!evt.target.state.focused) | |
| 241 return; | |
| 242 | |
| 243 // Value change events fire on web editables when typing. Suppress them. | 240 // Value change events fire on web editables when typing. Suppress them. |
| 244 if (!ChromeVoxState.instance.currentRange || | 241 if (!ChromeVoxState.instance.currentRange || |
| 245 !this.isEditable_(evt.target)) { | 242 !this.isEditable_(evt.target)) { |
| 246 this.onEventDefault(evt); | 243 var range = cursors.Range.fromNode(evt.target); |
| 247 ChromeVoxState.instance.setCurrentRange( | 244 new Output().withSpeechAndBraille(range, range, evt.type) |
| 248 cursors.Range.fromNode(evt.target)); | 245 .go(); |
| 249 } | 246 } |
| 250 }, | 247 }, |
| 251 | 248 |
| 252 /** | 249 /** |
| 253 * Handle updating the active indicator when the document scrolls. | 250 * Handle updating the active indicator when the document scrolls. |
| 254 * @override | 251 * @override |
| 255 */ | 252 */ |
| 256 onScrollPositionChanged: function(evt) { | 253 onScrollPositionChanged: function(evt) { |
| 257 var currentRange = ChromeVoxState.instance.currentRange; | 254 var currentRange = ChromeVoxState.instance.currentRange; |
| 258 if (currentRange) | 255 if (currentRange) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 if (cvox.ChromeVox.isMac) | 302 if (cvox.ChromeVox.isMac) |
| 306 return; | 303 return; |
| 307 chrome.automation.getDesktop(function(desktop) { | 304 chrome.automation.getDesktop(function(desktop) { |
| 308 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 305 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
| 309 }); | 306 }); |
| 310 }; | 307 }; |
| 311 | 308 |
| 312 DesktopAutomationHandler.init_(); | 309 DesktopAutomationHandler.init_(); |
| 313 | 310 |
| 314 }); // goog.scope | 311 }); // goog.scope |
| OLD | NEW |