| 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..3cb85702018f9eeb52e404cfaffb6bfb42a37986 100644
|
| --- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| +++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| @@ -14,6 +14,8 @@ var forEach = require('utils').forEach;
|
| var lastError = require('lastError');
|
| var logging = requireNative('logging');
|
| var schema = requireNative('automationInternal').GetSchemaAdditions();
|
| +var GetAutomationInternalRoutingID =
|
| + requireNative('automationInternal').GetAutomationInternalRoutingID;
|
|
|
| /**
|
| * A namespace to export utility functions to other files in automation.
|
| @@ -54,6 +56,8 @@ automation.registerCustomHook(function(bindingsAPI) {
|
|
|
| // TODO(aboxhall, dtseng): Make this return the speced AutomationRootNode obj.
|
| apiFunctions.setHandleRequest('getTree', function getTree(tabId, callback) {
|
| + var routingId = GetAutomationInternalRoutingID();
|
| +
|
| // 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 +65,14 @@ 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);
|
| - });
|
| + automationInternal.enableTab(routingId, tabId,
|
| + function onEnable(id) {
|
| + if (lastError.hasError(chrome)) {
|
| + callback();
|
| + return;
|
| + }
|
| + automationUtil.storeTreeCallback(id, callback);
|
| + });
|
| });
|
|
|
| var desktopTree = null;
|
| @@ -80,9 +85,11 @@ automation.registerCustomHook(function(bindingsAPI) {
|
| else
|
| idToCallback[DESKTOP_TREE_ID] = [callback];
|
|
|
| + var routingId = GetAutomationInternalRoutingID();
|
| +
|
| // 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];
|
|
|