Index: chrome/renderer/resources/extensions/automation_custom_bindings.js |
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js |
index 3d38afc4e0a5c427a40f93c8108a22a99e5aaede..b2fc5c3b711d1b9dc49fb8c04648d91c33aef577 100644 |
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js |
@@ -13,7 +13,10 @@ var Event = eventBindings.Event; |
var forEach = require('utils').forEach; |
var lastError = require('lastError'); |
var logging = requireNative('logging'); |
-var schema = requireNative('automationInternal').GetSchemaAdditions(); |
+var nativeAutomationInternal = requireNative('automationInternal'); |
+var GetRoutingID = nativeAutomationInternal.GetRoutingID; |
+var GetSchemaAdditions = nativeAutomationInternal.GetSchemaAdditions; |
+var schema = GetSchemaAdditions(); |
/** |
* A namespace to export utility functions to other files in automation. |
@@ -53,7 +56,9 @@ automation.registerCustomHook(function(bindingsAPI) { |
var apiFunctions = bindingsAPI.apiFunctions; |
// TODO(aboxhall, dtseng): Make this return the speced AutomationRootNode obj. |
- apiFunctions.setHandleRequest('getTree', function getTree(tabId, callback) { |
+ apiFunctions.setHandleRequest('getTree', function getTree(tabID, callback) { |
+ var routingID = GetRoutingID(); |
+ |
// enableTab() ensures the renderer for the active or specified tab has |
// accessibility enabled, and fetches its ax tree id to use as |
// a key in the idToAutomationRootNode map. The callback to |
@@ -61,13 +66,15 @@ automation.registerCustomHook(function(bindingsAPI) { |
// 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 |
// callback can be called. |
- automationInternal.enableTab(tabId, function onEnable(id) { |
- if (lastError.hasError(chrome)) { |
- callback(); |
- return; |
- } |
- automationUtil.storeTreeCallback(id, callback); |
- }); |
+ var params = { routingID: routingID, tabID: tabID }; |
+ automationInternal.enableTab(params, |
+ function onEnable(id) { |
+ if (lastError.hasError(chrome)) { |
+ callback(); |
+ return; |
+ } |
+ automationUtil.storeTreeCallback(id, callback); |
+ }); |
}); |
var desktopTree = null; |
@@ -80,9 +87,11 @@ automation.registerCustomHook(function(bindingsAPI) { |
else |
idToCallback[DESKTOP_TREE_ID] = [callback]; |
+ var routingID = GetRoutingID(); |
+ |
// TODO(dtseng): Disable desktop tree once desktop object goes out of |
// scope. |
- automationInternal.enableDesktop(function() { |
+ automationInternal.enableDesktop(routingID, function() { |
if (lastError.hasError(chrome)) { |
delete idToAutomationRootNode[ |
DESKTOP_TREE_ID]; |