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

Unified Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 514363002: Remove attributes and methods which should not be part of the public API (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Ensure we're using the internal id rather than expecting the public getter to exist (it doesn't) Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/automation/automation_node.js
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index 7a1854a4ce78c23bb9d7df52e170908b8405e953..310ceb0d13fbb57f38ebd251e89d0b34af9f9ff1 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -197,7 +197,7 @@ AutomationNodeImpl.prototype = {
// Not yet initialized.
if (this.rootImpl.processID === undefined ||
this.rootImpl.routingID === undefined ||
- this.wrapper.id === undefined) {
+ this.id === undefined) {
return;
}
@@ -209,7 +209,7 @@ AutomationNodeImpl.prototype = {
automationInternal.performAction({ processID: this.rootImpl.processID,
routingID: this.rootImpl.routingID,
- automationNodeID: this.wrapper.id,
+ automationNodeID: this.id,
actionType: actionType },
opt_args || {});
}
@@ -329,8 +329,9 @@ AutomationRootNodeImpl.prototype = {
var children = nodeToClear.children();
for (var i = 0; i < children.length; i++)
this.invalidate_(children[i]);
- privates(nodeToClear).impl.childIds = []
- updateState.pendingNodes[nodeToClear.id] = nodeToClear;
+ var nodeToClearImpl = privates(nodeToClear).impl;
+ nodeToClearImpl.childIds = []
+ updateState.pendingNodes[nodeToClearImpl.id] = nodeToClear;
}
}
@@ -402,7 +403,7 @@ AutomationRootNodeImpl.prototype = {
// This object is not accessible outside of bindings code, but we can access
// it here.
var nodeImpl = privates(node).impl;
- var id = node.id;
+ var id = nodeImpl.id;
for (var key in AutomationAttributeDefaults) {
nodeImpl[key] = AutomationAttributeDefaults[key];
}
@@ -427,8 +428,8 @@ AutomationRootNodeImpl.prototype = {
for (var i = 0; i < newChildIds.length; i++) {
var childId = newChildIds[i];
if (newChildIdSet[childId]) {
- logging.WARNING('Node ' + node.id + ' has duplicate child id ' +
- childId);
+ logging.WARNING('Node ' + privates(node).impl.id +
+ ' has duplicate child id ' + childId);
lastError.set('automation',
'Bad update received on automation tree',
null,
@@ -464,12 +465,13 @@ AutomationRootNodeImpl.prototype = {
if (childNode) {
if (childNode.parent() != node) {
var parentId = 0;
David Tseng 2014/08/29 22:02:23 nit: We use 0 elsewhere as a valid id. Maybe -1?
aboxhall 2014/08/30 17:46:41 Done.
- if (childNode.parent()) parentId = childNode.parent().id;
+ var parentImpl = privates(childNode.parent()).impl;
David Tseng 2014/08/29 22:02:23 This should be in the if clause's body right?
aboxhall 2014/08/30 17:46:42 Done.
+ if (childNode.parent()) parentId = parentImpl.id;
David Tseng 2014/08/29 22:02:23 if (...) ... (the one line if is pretty hard to
aboxhall 2014/08/30 17:46:42 Done.
// This is a serious error - nodes should never be reparented.
// If this case occurs, continue so this node isn't left in an
// inconsistent state, but return failure at the end.
logging.WARNING('Node ' + childId + ' reparented from ' +
- parentId + ' to ' + node.id);
+ parentId + ' to ' + privates(node).impl.id);
lastError.set('automation',
'Bad update received on automation tree',
null,
@@ -481,11 +483,11 @@ AutomationRootNodeImpl.prototype = {
childNode = new AutomationNode(this);
this.axNodeDataCache_[childId] = childNode;
privates(childNode).impl.id = childId;
- updateState.pendingNodes[childNode.id] = childNode;
- updateState.newNodes[childNode.id] = childNode;
+ updateState.pendingNodes[childId] = childNode;
+ updateState.newNodes[childId] = childNode;
}
privates(childNode).impl.indexInParent = i;
- privates(childNode).impl.parentID = node.id;
+ privates(childNode).impl.parentID = privates(node).impl.id;
}
return success;
@@ -548,7 +550,7 @@ AutomationRootNodeImpl.prototype = {
var node = this.axNodeDataCache_[nodeData.id];
var didUpdateRoot = false;
if (node) {
- delete updateState.pendingNodes[node.id];
+ delete updateState.pendingNodes[privates(node).impl.id];
} else {
if (nodeData.role != schema.RoleType.rootWebArea &&
nodeData.role != schema.RoleType.desktop) {
@@ -582,7 +584,7 @@ AutomationRootNodeImpl.prototype = {
nodeData.childIds,
updateState);
nodeImpl.childIds = nodeData.childIds;
- this.axNodeDataCache_[node.id] = node;
+ this.axNodeDataCache_[nodeImpl.id] = node;
return success;
}
@@ -602,16 +604,13 @@ var AutomationNode = utils.expose('AutomationNode',
'makeVisible',
'setSelection',
'addEventListener',
- 'removeEventListener',
- 'toString'],
+ 'removeEventListener'],
readonly: ['isRootNode',
- 'id',
'role',
'state',
'location',
'attributes',
- 'root',
- 'toString'] });
+ 'root'] });
var AutomationRootNode = utils.expose('AutomationRootNode',
AutomationRootNodeImpl,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698