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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.h

Issue 2917363002: Automatically fire AX events on Mac based on tree changes (Closed)
Patch Set: Fix accidental shadowing of BrowserAccessibilityManager::OnAtomicUpdateFinished, caught by browser … Created 3 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
Index: content/browser/accessibility/browser_accessibility_manager.h
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h
index fa0478a92ed71d42e1f920c1d7aac8c42a71ca21..cc4910e106f907d4d2d70b632d8f40f7455aedaa 100644
--- a/content/browser/accessibility/browser_accessibility_manager.h
+++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -343,7 +343,9 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
void OnNodeDataWillChange(ui::AXTree* tree,
const ui::AXNodeData& old_node_data,
const ui::AXNodeData& new_node_data) override;
- void OnTreeDataChanged(ui::AXTree* tree) override;
+ void OnTreeDataChanged(ui::AXTree* tree,
+ const ui::AXTreeData& old_tree_data,
+ const ui::AXTreeData& new_tree_data) override;
void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override;
void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override;
void OnNodeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override;
@@ -443,9 +445,10 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
// A mapping from a node id to its wrapper of type BrowserAccessibility.
base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_;
- // A queue of accessibility events to fire based on changes to the
- // accessibility tree. Each one is an event and a node id.
- std::vector<std::pair<ui::AXEvent, int32_t>> tree_events_;
+ // A set of accessibility events to fire based on changes to the
+ // accessibility tree. It's represented as a map from node id
+ // to a set of events, which makes it easy to remove duplicates.
+ std::map<int32_t, std::set<ui::AXEvent>> tree_events_;
// True if the user has initiated a navigation to another page.
bool user_is_navigating_away_;

Powered by Google App Engine
This is Rietveld 408576698