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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 // Value change events fire on web text fields and text areas when pressing | 245 // Value change events fire on web text fields and text areas when pressing |
246 // enter; suppress them. | 246 // enter; suppress them. |
247 if (!global.backgroundObj.currentRange || | 247 if (!global.backgroundObj.currentRange || |
248 evt.target.role != RoleType.textField) { | 248 evt.target.role != RoleType.textField) { |
249 this.onEventDefault(evt); | 249 this.onEventDefault(evt); |
250 global.backgroundObj.currentRange = cursors.Range.fromNode(evt.target); | 250 global.backgroundObj.currentRange = cursors.Range.fromNode(evt.target); |
251 } | 251 } |
252 }, | 252 }, |
253 | 253 |
254 /** | 254 /** |
255 * Handle updating the active indicator when the document scrolls. | |
256 * @param {Object} evt | |
Peter Lundblad
2015/11/23 13:39:08
nit: I think this @param is redundant given overri
dmazzoni
2015/11/23 17:22:49
Done.
| |
257 * @override | |
258 */ | |
259 onScrollPositionChanged: function(evt) { | |
260 var currentRange = global.backgroundObj.currentRange; | |
261 if (currentRange) | |
262 new Output().withLocation(currentRange, null, evt.type).go(); | |
263 }, | |
264 | |
265 /** | |
255 * Create an editable text handler for the given node if needed. | 266 * Create an editable text handler for the given node if needed. |
256 * @param {Object} node | 267 * @param {Object} node |
257 */ | 268 */ |
258 createEditableTextHandlerIfNeeded_: function(node) { | 269 createEditableTextHandlerIfNeeded_: function(node) { |
259 if (!this.editableTextHandler_ || | 270 if (!this.editableTextHandler_ || |
260 node != global.backgroundObj.currentRange.start.node) { | 271 node != global.backgroundObj.currentRange.start.node) { |
261 var start = node.textSelStart; | 272 var start = node.textSelStart; |
262 var end = node.textSelEnd; | 273 var end = node.textSelEnd; |
263 if (start > end) { | 274 if (start > end) { |
264 var tempOffset = end; | 275 var tempOffset = end; |
(...skipping 20 matching lines...) Expand all Loading... | |
285 if (cvox.ChromeVox.isMac) | 296 if (cvox.ChromeVox.isMac) |
286 return; | 297 return; |
287 chrome.automation.getDesktop(function(desktop) { | 298 chrome.automation.getDesktop(function(desktop) { |
288 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 299 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
289 }); | 300 }); |
290 }; | 301 }; |
291 | 302 |
292 DesktopAutomationHandler.init_(); | 303 DesktopAutomationHandler.init_(); |
293 | 304 |
294 }); // goog.scope | 305 }); // goog.scope |
OLD | NEW |