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

Side by Side Diff: chrome/renderer/resources/extensions/automation_custom_bindings.js

Issue 2093753002: Reland: Make ChromeVox Next a setting in options page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom bindings for the automation API. 5 // Custom bindings for the automation API.
6 var AutomationNode = require('automationNode').AutomationNode; 6 var AutomationNode = require('automationNode').AutomationNode;
7 var AutomationRootNode = require('automationNode').AutomationRootNode; 7 var AutomationRootNode = require('automationNode').AutomationRootNode;
8 var automation = require('binding').Binding.create('automation'); 8 var automation = require('binding').Binding.create('automation');
9 var automationInternal = 9 var automationInternal =
10 require('binding').Binding.create('automationInternal').generate(); 10 require('binding').Binding.create('automationInternal').generate();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // currently have cached, explicitly request that AX tree from the 203 // currently have cached, explicitly request that AX tree from the
204 // browser process and set up a callback when it loads to attach that 204 // browser process and set up a callback when it loads to attach that
205 // tree as a child of this node and fire appropriate events. 205 // tree as a child of this node and fire appropriate events.
206 var childTreeID = GetIntAttribute(treeID, nodeID, 'childTreeId'); 206 var childTreeID = GetIntAttribute(treeID, nodeID, 'childTreeId');
207 if (!childTreeID) 207 if (!childTreeID)
208 return; 208 return;
209 209
210 var subroot = AutomationRootNode.get(childTreeID); 210 var subroot = AutomationRootNode.get(childTreeID);
211 if (!subroot) { 211 if (!subroot) {
212 automationUtil.storeTreeCallback(childTreeID, function(root) { 212 automationUtil.storeTreeCallback(childTreeID, function(root) {
213 // Return early if the root has already been attached.
214 if (root.parent)
215 return;
216
213 privates(root).impl.setHostNode(node); 217 privates(root).impl.setHostNode(node);
214 218
215 if (root.docLoaded) 219 if (root.docLoaded)
216 privates(root).impl.dispatchEvent(schema.EventType.loadComplete); 220 privates(root).impl.dispatchEvent(schema.EventType.loadComplete);
217 221
218 privates(node).impl.dispatchEvent(schema.EventType.childrenChanged); 222 privates(node).impl.dispatchEvent(schema.EventType.childrenChanged);
219 }); 223 });
220 224
221 automationInternal.enableFrame(childTreeID); 225 automationInternal.enableFrame(childTreeID);
222 } else { 226 } else {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 330
327 var binding = automation.generate(); 331 var binding = automation.generate();
328 // Add additional accessibility bindings not specified in the automation IDL. 332 // Add additional accessibility bindings not specified in the automation IDL.
329 // Accessibility and automation share some APIs (see 333 // Accessibility and automation share some APIs (see
330 // ui/accessibility/ax_enums.idl). 334 // ui/accessibility/ax_enums.idl).
331 forEach(schema, function(k, v) { 335 forEach(schema, function(k, v) {
332 binding[k] = v; 336 binding[k] = v;
333 }); 337 });
334 338
335 exports.$set('binding', binding); 339 exports.$set('binding', binding);
336
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698