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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 onLoadComplete: function(evt) { | 240 onLoadComplete: function(evt) { |
241 // Don't process nodes inside of web content if ChromeVox Next is inactive. | 241 // Don't process nodes inside of web content if ChromeVox Next is inactive. |
242 if (evt.target.root.role != RoleType.desktop && | 242 if (evt.target.root.role != RoleType.desktop && |
243 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) | 243 ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) |
244 return; | 244 return; |
245 | 245 |
246 chrome.automation.getFocus(function(focus) { | 246 chrome.automation.getFocus(function(focus) { |
247 if (!focus || !AutomationUtil.isDescendantOf(focus, evt.target)) | 247 if (!focus || !AutomationUtil.isDescendantOf(focus, evt.target)) |
248 return; | 248 return; |
249 | 249 |
| 250 // Create text edit handler, if needed, now in order not to miss initial |
| 251 // value change if text field has already been focused when initializing |
| 252 // ChromeVox. |
| 253 this.createTextEditHandlerIfNeeded_(focus); |
| 254 |
250 // If initial focus was already placed on this page (e.g. if a user starts | 255 // If initial focus was already placed on this page (e.g. if a user starts |
251 // tabbing before load complete), then don't move ChromeVox's position on | 256 // tabbing before load complete), then don't move ChromeVox's position on |
252 // the page. | 257 // the page. |
253 if (ChromeVoxState.instance.currentRange && | 258 if (ChromeVoxState.instance.currentRange && |
254 ChromeVoxState.instance.currentRange.start.node.root == focus.root) | 259 ChromeVoxState.instance.currentRange.start.node.root == focus.root) |
255 return; | 260 return; |
256 | 261 |
257 var o = new Output(); | 262 var o = new Output(); |
258 if (focus.role == RoleType.rootWebArea) { | 263 if (focus.role == RoleType.rootWebArea) { |
259 // Restore to previous position. | 264 // Restore to previous position. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 DesktopAutomationHandler.init_ = function() { | 420 DesktopAutomationHandler.init_ = function() { |
416 chrome.automation.getDesktop(function(desktop) { | 421 chrome.automation.getDesktop(function(desktop) { |
417 ChromeVoxState.desktopAutomationHandler = | 422 ChromeVoxState.desktopAutomationHandler = |
418 new DesktopAutomationHandler(desktop); | 423 new DesktopAutomationHandler(desktop); |
419 }); | 424 }); |
420 }; | 425 }; |
421 | 426 |
422 DesktopAutomationHandler.init_(); | 427 DesktopAutomationHandler.init_(); |
423 | 428 |
424 }); // goog.scope | 429 }); // goog.scope |
OLD | NEW |