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

Side by Side Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 939853003: Revert of Reland #4: Ensure WebView notifies desktop automation on creation, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 var AutomationEvent = require('automationEvent').AutomationEvent; 5 var AutomationEvent = require('automationEvent').AutomationEvent;
6 var automationInternal = 6 var automationInternal =
7 require('binding').Binding.create('automationInternal').generate(); 7 require('binding').Binding.create('automationInternal').generate();
8 var IsInteractPermitted = 8 var IsInteractPermitted =
9 requireNative('automationInternal').IsInteractPermitted; 9 requireNative('automationInternal').IsInteractPermitted;
10 10
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 } 721 }
722 722
723 return success; 723 return success;
724 }, 724 },
725 725
726 setData_: function(node, nodeData) { 726 setData_: function(node, nodeData) {
727 var nodeImpl = privates(node).impl; 727 var nodeImpl = privates(node).impl;
728 728
729 // TODO(dtseng): Make into set listing all hosting node roles. 729 // TODO(dtseng): Make into set listing all hosting node roles.
730 if (nodeData.role == schema.RoleType.webView) { 730 if (nodeData.role == schema.RoleType.webView) {
731 if (nodeImpl.childTreeID !== nodeData.intAttributes.childTreeId) 731 if (nodeImpl.pendingChildFrame === undefined)
732 nodeImpl.pendingChildFrame = true; 732 nodeImpl.pendingChildFrame = true;
733 733
734 if (nodeImpl.pendingChildFrame) { 734 if (nodeImpl.pendingChildFrame) {
735 nodeImpl.childTreeID = nodeData.intAttributes.childTreeId; 735 nodeImpl.childTreeID = nodeData.intAttributes.childTreeId;
736 automationInternal.enableFrame(nodeImpl.childTreeID);
736 automationUtil.storeTreeCallback(nodeImpl.childTreeID, function(root) { 737 automationUtil.storeTreeCallback(nodeImpl.childTreeID, function(root) {
737 nodeImpl.pendingChildFrame = false; 738 nodeImpl.pendingChildFrame = false;
738 nodeImpl.childTree = root; 739 nodeImpl.childTree = root;
739 privates(root).impl.hostTree = node; 740 privates(root).impl.hostTree = node;
740 if (root.attributes.docLoadingProgress == 1)
741 privates(root).impl.dispatchEvent(schema.EventType.loadComplete);
742 nodeImpl.dispatchEvent(schema.EventType.childrenChanged); 741 nodeImpl.dispatchEvent(schema.EventType.childrenChanged);
743 }); 742 });
744 automationInternal.enableFrame(nodeImpl.childTreeID);
745 } 743 }
746 } 744 }
747 for (var key in AutomationAttributeDefaults) { 745 for (var key in AutomationAttributeDefaults) {
748 if (key in nodeData) 746 if (key in nodeData)
749 nodeImpl[key] = nodeData[key]; 747 nodeImpl[key] = nodeData[key];
750 else 748 else
751 nodeImpl[key] = AutomationAttributeDefaults[key]; 749 nodeImpl[key] = AutomationAttributeDefaults[key];
752 } 750 }
753 751
754 // Set all basic attributes. 752 // Set all basic attributes.
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 'attributes', 983 'attributes',
986 'indexInParent', 984 'indexInParent',
987 'root'] }); 985 'root'] });
988 986
989 var AutomationRootNode = utils.expose('AutomationRootNode', 987 var AutomationRootNode = utils.expose('AutomationRootNode',
990 AutomationRootNodeImpl, 988 AutomationRootNodeImpl,
991 { superclass: AutomationNode }); 989 { superclass: AutomationNode });
992 990
993 exports.AutomationNode = AutomationNode; 991 exports.AutomationNode = AutomationNode;
994 exports.AutomationRootNode = AutomationRootNode; 992 exports.AutomationRootNode = AutomationRootNode;
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/testing/mock_tts.js ('k') | chrome/test/base/extension_js_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698