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

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

Issue 2080573003: Track all changed nodes during an update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make suggested change. Created 4 years, 3 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
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. 213 // Return early if the root has already been attached.
214 if (root.parent) 214 if (root.parent)
215 return; 215 return;
216 216
217 privates(root).impl.setHostNode(node); 217 privates(root).impl.setHostNode(node);
218 218
219 if (root.docLoaded) 219 if (root.docLoaded) {
220 privates(root).impl.dispatchEvent(schema.EventType.loadComplete); 220 privates(root).impl.dispatchEvent(
221 schema.EventType.loadComplete, 'page');
222 }
221 223
222 privates(node).impl.dispatchEvent(schema.EventType.childrenChanged); 224 privates(node).impl.dispatchEvent(
225 schema.EventType.childrenChanged, 'none');
223 }); 226 });
224 227
225 automationInternal.enableFrame(childTreeID); 228 automationInternal.enableFrame(childTreeID);
226 } else { 229 } else {
227 privates(subroot).impl.setHostNode(node); 230 privates(subroot).impl.setHostNode(node);
228 } 231 }
229 }); 232 });
230 233
231 automationInternal.onTreeChange.addListener(function(observerID, 234 automationInternal.onTreeChange.addListener(function(observerID,
232 treeID, 235 treeID,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 333
331 var binding = automation.generate(); 334 var binding = automation.generate();
332 // Add additional accessibility bindings not specified in the automation IDL. 335 // Add additional accessibility bindings not specified in the automation IDL.
333 // Accessibility and automation share some APIs (see 336 // Accessibility and automation share some APIs (see
334 // ui/accessibility/ax_enums.idl). 337 // ui/accessibility/ax_enums.idl).
335 forEach(schema, function(k, v) { 338 forEach(schema, function(k, v) {
336 binding[k] = v; 339 binding[k] = v;
337 }); 340 });
338 341
339 exports.$set('binding', binding); 342 exports.$set('binding', binding);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698