diff options
Diffstat (limited to 'chrome/renderer/resources/extensions/automation_custom_bindings.js')
-rw-r--r-- | chrome/renderer/resources/extensions/automation_custom_bindings.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js index 96e9e8d..8a0fe48 100644 --- a/chrome/renderer/resources/extensions/automation_custom_bindings.js +++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js @@ -4,7 +4,7 @@ // Custom bindings for the automation API. var AutomationNode = require('automationNode').AutomationNode; -var AutomationTree = require('automationTree').AutomationTree; +var AutomationRootNode = require('automationNode').AutomationRootNode; var automation = require('binding').Binding.create('automation'); var automationInternal = require('binding').Binding.create('automationInternal').generate(); @@ -16,20 +16,20 @@ var schema = requireNative('automationInternal').GetSchemaAdditions(); // TODO(aboxhall): Look into using WeakMap -var idToAutomationTree = {}; +var idToAutomationRootNode = {}; var idToCallback = {}; // TODO(dtseng): Move out to automation/automation_util.js or as a static member -// of AutomationTree to keep this file clean. +// of AutomationRootNode to keep this file clean. /* - * Creates an id associated with a particular AutomationTree based upon a + * Creates an id associated with a particular AutomationRootNode based upon a * renderer/renderer host pair's process and routing id. */ -var createAutomationTreeID = function(pid, rid) { +var createAutomationRootNodeID = function(pid, rid) { return pid + '_' + rid; }; -var DESKTOP_TREE_ID = createAutomationTreeID(0, 0); +var DESKTOP_TREE_ID = createAutomationRootNodeID(0, 0); automation.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; @@ -38,7 +38,7 @@ automation.registerCustomHook(function(bindingsAPI) { apiFunctions.setHandleRequest('getTree', function getTree(tabId, callback) { // enableTab() ensures the renderer for the active or specified tab has // accessibility enabled, and fetches its process and routing ids to use as - // a key in the idToAutomationTree map. The callback to enableActiveTab is + // a key in the idToAutomationRootNode map. The callback to enableTab is is // bound to the callback passed in to getTree(), so that once the tree is // available (either due to having been cached earlier, or after an // accessibility event occurs which causes the tree to be populated), the @@ -48,8 +48,8 @@ automation.registerCustomHook(function(bindingsAPI) { callback(); return; } - var id = createAutomationTreeID(pid, rid); - var targetTree = idToAutomationTree[id]; + var id = createAutomationRootNodeID(pid, rid); + var targetTree = idToAutomationRootNode[id]; if (!targetTree) { // If we haven't cached the tree, hold the callback until the tree is // populated by the initial onAccessibilityEvent call. @@ -65,7 +65,7 @@ automation.registerCustomHook(function(bindingsAPI) { var desktopTree = null; apiFunctions.setHandleRequest('getDesktop', function(callback) { - desktopTree = idToAutomationTree[DESKTOP_TREE_ID]; + desktopTree = idToAutomationRootNode[DESKTOP_TREE_ID]; if (!desktopTree) { if (DESKTOP_TREE_ID in idToCallback) idToCallback[DESKTOP_TREE_ID].push(callback); @@ -76,7 +76,7 @@ automation.registerCustomHook(function(bindingsAPI) { // scope. automationInternal.enableDesktop(function() { if (lastError.hasError(chrome)) { - delete idToAutomationTree[DESKTOP_TREE_ID]; + delete idToAutomationRootNode[DESKTOP_TREE_ID]; callback(); return; } @@ -93,14 +93,14 @@ automation.registerCustomHook(function(bindingsAPI) { automationInternal.onAccessibilityEvent.addListener(function(data) { var pid = data.processID; var rid = data.routingID; - var id = createAutomationTreeID(pid, rid); - var targetTree = idToAutomationTree[id]; + var id = createAutomationRootNodeID(pid, rid); + var targetTree = idToAutomationRootNode[id]; if (!targetTree) { // If this is the first time we've gotten data for this tree, it will // contain all of the tree's data, so create a new tree which will be // bootstrapped from |data|. - targetTree = new AutomationTree(pid, rid); - idToAutomationTree[id] = targetTree; + targetTree = new AutomationRootNode(pid, rid); + idToAutomationRootNode[id] = targetTree; } privates(targetTree).impl.update(data); var eventType = data.eventType; |