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

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: Handle case where RenderThread destroys AutomationMessageFilter first Created 5 years, 6 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
« no previous file with comments | « chrome/renderer/extensions/automation_internal_custom_bindings.cc ('k') | components/network_hints.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « chrome/renderer/extensions/automation_internal_custom_bindings.cc ('k') | components/network_hints.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698