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

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

Issue 2649373002: Re-land: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Fix presubmit Created 3 years, 11 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 92ef4cb902a3850faf4e1eedca5ef6c11d3904ad..1038fd35ca2a55904117aef659f9fa85221c291d 100644
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -16,7 +16,6 @@ var lastError = require('lastError');
var logging = requireNative('logging');
var nativeAutomationInternal = requireNative('automationInternal');
var GetRoutingID = nativeAutomationInternal.GetRoutingID;
-var GetSchemaAdditions = nativeAutomationInternal.GetSchemaAdditions;
var DestroyAccessibilityTree =
nativeAutomationInternal.DestroyAccessibilityTree;
var GetIntAttribute = nativeAutomationInternal.GetIntAttribute;
@@ -26,7 +25,6 @@ var AddTreeChangeObserver = nativeAutomationInternal.AddTreeChangeObserver;
var RemoveTreeChangeObserver =
nativeAutomationInternal.RemoveTreeChangeObserver;
var GetFocusNative = nativeAutomationInternal.GetFocus;
-var schema = GetSchemaAdditions();
/**
* A namespace to export utility functions to other files in automation.
@@ -220,7 +218,7 @@ automationInternal.onChildTreeID.addListener(function(treeID,
return;
var subroot = AutomationRootNode.get(childTreeID);
- if (!subroot || subroot.role == schema.EventType.unknown) {
+ if (!subroot || subroot.role == 'unknown') {
automationUtil.storeTreeCallback(childTreeID, function(root) {
// Return early if the root has already been attached.
if (root.parent)
@@ -229,12 +227,10 @@ automationInternal.onChildTreeID.addListener(function(treeID,
privates(root).impl.setHostNode(node);
if (root.docLoaded) {
- privates(root).impl.dispatchEvent(
- schema.EventType.loadComplete, 'page');
+ privates(root).impl.dispatchEvent('loadComplete', 'page');
}
- privates(node).impl.dispatchEvent(
- schema.EventType.childrenChanged, 'none');
+ privates(node).impl.dispatchEvent('childrenChanged', 'none');
});
automationInternal.enableFrame(childTreeID);
@@ -287,17 +283,17 @@ automationInternal.onAccessibilityEvent.addListener(function(eventParams) {
var targetTree = AutomationRootNode.getOrCreate(id);
var isFocusEvent = false;
- if (eventParams.eventType == schema.EventType.focus) {
+ if (eventParams.eventType == 'focus') {
isFocusEvent = true;
- } else if (eventParams.eventType == schema.EventType.blur) {
+ } else if (eventParams.eventType == 'blur') {
// Work around an issue where Chrome sends us 'blur' events on the
// root node when nothing has focus, we need to treat those as focus
// events but otherwise not handle blur events specially.
var node = privates(targetTree).impl.get(eventParams.targetID);
if (node == node.root)
automationUtil.updateFocusedNodeOnBlur();
- } else if (eventParams.eventType == schema.EventType.mediaStartedPlaying ||
- eventParams.eventType == schema.EventType.mediaStoppedPlaying) {
+ } else if (eventParams.eventType == 'mediaStartedPlaying' ||
+ eventParams.eventType == 'mediaStoppedPlaying') {
// These events are global to the tree.
eventParams.targetID = privates(targetTree).impl.id;
}
@@ -365,11 +361,4 @@ automationInternal.onAccessibilityTreeSerializationError.addListener(
});
var 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) {
- binding[k] = v;
-});
-
exports.$set('binding', binding);

Powered by Google App Engine
This is Rietveld 408576698