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

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

Issue 1716663002: Add a treeChange type to Automation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
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 826859edb42390cdf33ddb20fa405a2085ebf4ae..20457ebcb739bf35484cff12517d75b133550b02 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -989,6 +989,13 @@ void AutomationInternalCustomBindings::OnAccessibilityEvent(
args->Set(0U, event_params);
context()->DispatchEvent("automationInternal.onAccessibilityEvent", args);
}
+void AutomationInternalCustomBindings::OnNodeDataWillChange(
+ const ui::AXNodeData& old_node_data,
+ const ui::AXNodeData& new_node_data) {
+ if (old_node_data.GetStringAttribute(ui::AX_ATTR_NAME) !=
+ new_node_data.GetStringAttribute(ui::AX_ATTR_NAME))
+ text_changed_node_ids_.push_back(new_node_data.id);
+}
void AutomationInternalCustomBindings::OnTreeDataChanged(ui::AXTree* tree) {}
@@ -1050,6 +1057,12 @@ void AutomationInternalCustomBindings::OnAtomicUpdateFinished(
break;
}
}
+
+ for (size_t i = 0; i < text_changed_node_ids_.size(); ++i) {
+ SendTreeChangeEvent(api::automation::TREE_CHANGE_TYPE_TEXTCHANGED, tree,
+ tree->GetFromId(text_changed_node_ids_[i]));
+ text_changed_node_ids_.clear();
dmazzoni 2016/02/19 23:20:23 This clear should go after the for loop, not insid
+ }
}
void AutomationInternalCustomBindings::SendTreeChangeEvent(

Powered by Google App Engine
This is Rietveld 408576698