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

Unified Diff: chrome/renderer/extensions/automation_internal_custom_bindings.cc

Issue 2080573003: Track all changed nodes during an update (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/automation_internal_custom_bindings.cc
diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.cc b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
index f54aae809acd9bea2724b15328da6e164da28fe2..01085a898f5fc8b22f77f031461fe6c3dbedb88d 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -1097,18 +1097,17 @@ void AutomationInternalCustomBindings::OnTreeDataChanged(ui::AXTree* tree) {}
void AutomationInternalCustomBindings::OnNodeWillBeDeleted(ui::AXTree* tree,
ui::AXNode* node) {
- SendTreeChangeEvent(
- api::automation::TREE_CHANGE_TYPE_NODEREMOVED,
dmazzoni 2016/06/20 22:47:23 I think you still need to call this, otherwise we
- tree, node);
deleted_node_ids_.push_back(node->id());
+
+ // Don't do anything here because the update may reparent and not delete this
+ // node.
}
void AutomationInternalCustomBindings::OnSubtreeWillBeDeleted(
ui::AXTree* tree,
ui::AXNode* node) {
- // This isn't strictly needed, as OnNodeWillBeDeleted will already be
- // called. We could send a JS event for this only if it turns out to
- // be needed for something.
+ // Don't do anything here because the update may reparent and not delete this
+ // subtree.
}
void AutomationInternalCustomBindings::OnNodeCreated(ui::AXTree* tree,
@@ -1151,9 +1150,12 @@ void AutomationInternalCustomBindings::OnAtomicUpdateFinished(
api::automation::TREE_CHANGE_TYPE_NODECHANGED,
tree, node);
break;
- // Unhandled.
case NODE_REPARENTED:
case SUBTREE_REPARENTED:
+ auto iter = std::find(deleted_node_ids_.begin(),
+ deleted_node_ids_.end(), node->id());
+ if (iter != deleted_node_ids_.end())
+ deleted_node_ids_.erase(iter);
break;
}
}
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698