Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Custom bindings for the automation API. | 5 // Custom bindings for the automation API. |
| 6 var AutomationNode = require('automationNode').AutomationNode; | 6 var AutomationNode = require('automationNode').AutomationNode; |
| 7 var AutomationRootNode = require('automationNode').AutomationRootNode; | 7 var AutomationRootNode = require('automationNode').AutomationRootNode; |
| 8 var automation = require('binding').Binding.create('automation'); | 8 var automation = require('binding').Binding.create('automation'); |
| 9 var automationInternal = | 9 var automationInternal = |
| 10 require('binding').Binding.create('automationInternal').generate(); | 10 require('binding').Binding.create('automationInternal').generate(); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 privates(targetTree).impl.destroy(); | 340 privates(targetTree).impl.destroy(); |
| 341 AutomationRootNode.destroy(id); | 341 AutomationRootNode.destroy(id); |
| 342 } else { | 342 } else { |
| 343 logging.WARNING('no targetTree to destroy'); | 343 logging.WARNING('no targetTree to destroy'); |
| 344 } | 344 } |
| 345 | 345 |
| 346 // Destroy the native cache of the accessibility tree. | 346 // Destroy the native cache of the accessibility tree. |
| 347 DestroyAccessibilityTree(id); | 347 DestroyAccessibilityTree(id); |
| 348 }); | 348 }); |
| 349 | 349 |
| 350 automationInternal.onAccessibilityTreeSerializationError.addListener(function(id ) { | |
|
dmazzoni
2016/11/22 18:11:42
nit: wrap
David Tseng
2016/11/22 18:26:28
Done.
| |
| 351 // Possibly clear native focus. | |
|
dmazzoni
2016/11/22 18:11:42
Is this necessary? Won't it fix itself when the ne
David Tseng
2016/11/22 18:26:28
Navigation could still occur before then, but like
| |
| 352 var focusedNodeInfo = GetFocusNative(DESKTOP_TREE_ID); | |
| 353 if (focusedNodeInfo && focusedNodeInfo.treeId == id) | |
| 354 automationUtil.focusedNode = null; | |
| 355 automationInternal.enableFrame(id); | |
|
dmazzoni
2016/11/22 18:11:42
Does calling enableFrame() force it to reset?
I t
David Tseng
2016/11/22 18:26:28
Let's rename this to enableOrResetFrame (in anothe
| |
| 356 }); | |
| 357 | |
| 350 var binding = automation.generate(); | 358 var binding = automation.generate(); |
| 351 // Add additional accessibility bindings not specified in the automation IDL. | 359 // Add additional accessibility bindings not specified in the automation IDL. |
| 352 // Accessibility and automation share some APIs (see | 360 // Accessibility and automation share some APIs (see |
| 353 // ui/accessibility/ax_enums.idl). | 361 // ui/accessibility/ax_enums.idl). |
| 354 forEach(schema, function(k, v) { | 362 forEach(schema, function(k, v) { |
| 355 binding[k] = v; | 363 binding[k] = v; |
| 356 }); | 364 }); |
| 357 | 365 |
| 358 exports.$set('binding', binding); | 366 exports.$set('binding', binding); |
| OLD | NEW |