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