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; |
} |
} |