Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: chrome/renderer/resources/extensions/automation_custom_bindings.js

Issue 1151523009: Forward accessibility events to the automation extension process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@step1
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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];

Powered by Google App Engine
This is Rietveld 408576698