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

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

Issue 304293002: Add human readable programmatic enum name/values to chrome.automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last feedback. Created 6 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 023902cbdc345491286dfb3476e5d5a47cf32e95..9994bf50e7b858a554e700ef905d41b5250c4a50 100644
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -10,7 +10,10 @@ var automationInternal =
require('binding').Binding.create('automationInternal').generate();
var eventBindings = require('event_bindings');
var Event = eventBindings.Event;
+var forEach = require('utils').forEach;
var lastError = require('lastError');
+var schema =
+ requireNative('automationInternal').GetSchemaAdditions();
// TODO(aboxhall): Look into using WeakMap
var idToAutomationTree = {};
@@ -116,3 +119,10 @@ automationInternal.onAccessibilityEvent.addListener(function(data) {
});
exports.binding = automation.generate();
+
+// Add additional accessibility bindings not specified in the automation IDL.
+// Accessibility and automation share some APIs (see
+// ui/accessibility/ax_enums.idl).
+forEach(schema, function(k, v) {
+ exports.binding[k] = v;
+});

Powered by Google App Engine
This is Rietveld 408576698