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

Unified Diff: ui/accessibility/ax_tree.cc

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Revert comment. Created 3 years, 7 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: ui/accessibility/ax_tree.cc
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc
index c726a4d02f5e4b0b75035a92bd4e647b6f8bd4f3..2dcf61eab6284a3f573561dd61b16a0a204b0246 100644
--- a/ui/accessibility/ax_tree.cc
+++ b/ui/accessibility/ax_tree.cc
@@ -128,6 +128,7 @@ AXTree::AXTree()
: delegate_(NULL), root_(NULL) {
AXNodeData root;
root.id = -1;
+ root.ClearBitfields();
AXTreeUpdate initial_state;
initial_state.root_id = -1;
@@ -360,10 +361,8 @@ void AXTree::CallNodeChangeCallbacks(AXNode* node, const AXNodeData& new_data) {
if (old_data.state != new_data.state) {
for (int i = AX_STATE_NONE + 1; i <= AX_STATE_LAST; ++i) {
AXState state = static_cast<AXState>(i);
- if (old_data.HasStateFlag(state) != new_data.HasStateFlag(state)) {
- delegate_->OnStateChanged(this, node, state,
- new_data.HasStateFlag(state));
- }
+ if (old_data.HasState(state) != new_data.HasState(state))
+ delegate_->OnStateChanged(this, node, state, new_data.HasState(state));
}
}

Powered by Google App Engine
This is Rietveld 408576698