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 * @override |
| 257 */ |
| 258 onScrollPositionChanged: function(evt) { |
| 259 var currentRange = global.backgroundObj.currentRange; |
| 260 if (currentRange) |
| 261 new Output().withLocation(currentRange, null, evt.type).go(); |
| 262 }, |
| 263 |
| 264 /** |
255 * Create an editable text handler for the given node if needed. | 265 * Create an editable text handler for the given node if needed. |
256 * @param {Object} node | 266 * @param {Object} node |
257 */ | 267 */ |
258 createEditableTextHandlerIfNeeded_: function(node) { | 268 createEditableTextHandlerIfNeeded_: function(node) { |
259 if (!this.editableTextHandler_ || | 269 if (!this.editableTextHandler_ || |
260 node != global.backgroundObj.currentRange.start.node) { | 270 node != global.backgroundObj.currentRange.start.node) { |
261 var start = node.textSelStart; | 271 var start = node.textSelStart; |
262 var end = node.textSelEnd; | 272 var end = node.textSelEnd; |
263 if (start > end) { | 273 if (start > end) { |
264 var tempOffset = end; | 274 var tempOffset = end; |
(...skipping 20 matching lines...) Expand all Loading... |
285 if (cvox.ChromeVox.isMac) | 295 if (cvox.ChromeVox.isMac) |
286 return; | 296 return; |
287 chrome.automation.getDesktop(function(desktop) { | 297 chrome.automation.getDesktop(function(desktop) { |
288 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); | 298 global.desktopAutomationHandler = new DesktopAutomationHandler(desktop); |
289 }); | 299 }); |
290 }; | 300 }; |
291 | 301 |
292 DesktopAutomationHandler.init_(); | 302 DesktopAutomationHandler.init_(); |
293 | 303 |
294 }); // goog.scope | 304 }); // goog.scope |
OLD | NEW |