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

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: <= 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 b63bf85c30871f797b77f79f8ad983e9d86031c0..8d8b9399abf5fff5241dd17f555edea69d7836c9 100644
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -11,6 +11,8 @@ var automationInternal =
var eventBindings = require('event_bindings');
var Event = eventBindings.Event;
var lastError = require('lastError');
+var schema =
+ requireNative('automationInternal').GetSchemaAdditions();
// TODO(aboxhall): Look into using WeakMap
var idToAutomationTree = {};
@@ -112,3 +114,8 @@ automationInternal.onAccessibilityEvent.addListener(function(data) {
});
exports.binding = automation.generate();
+
+// Additional bindings adopted from Accessibility.
+exports.binding.Event = schema.Event;
+exports.binding.Role = schema.Role;
+exports.binding.State = schema.State;
not at google - send to devlin 2014/05/29 18:26:21 you could go: forEach(schema, function(k, v) {
aboxhall 2014/05/29 18:35:49 -1 current code has same number of lines and is mo
not at google - send to devlin 2014/05/29 18:45:50 I don't think it's the job of this code to know wh
David Tseng 2014/05/29 19:04:40 Do you feel strongly? I could go either way on thi
not at google - send to devlin 2014/05/29 19:48:14 I rarely feel strongly to push back on a push back
David Tseng 2014/05/29 22:12:25 Ok; I've left a better comment. Also, I think we m

Powered by Google App Engine
This is Rietveld 408576698