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

Side by Side Diff: ui/accessibility/ax_tree.cc

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 const AXNodeData& old_data = node->data(); 354 const AXNodeData& old_data = node->data();
355 delegate_->OnNodeDataWillChange(this, old_data, new_data); 355 delegate_->OnNodeDataWillChange(this, old_data, new_data);
356 356
357 if (old_data.role != new_data.role) 357 if (old_data.role != new_data.role)
358 delegate_->OnRoleChanged(this, node, old_data.role, new_data.role); 358 delegate_->OnRoleChanged(this, node, old_data.role, new_data.role);
359 359
360 if (old_data.state != new_data.state) { 360 if (old_data.state != new_data.state) {
361 for (int i = AX_STATE_NONE + 1; i <= AX_STATE_LAST; ++i) { 361 for (int i = AX_STATE_NONE + 1; i <= AX_STATE_LAST; ++i) {
362 AXState state = static_cast<AXState>(i); 362 AXState state = static_cast<AXState>(i);
363 if (old_data.HasStateFlag(state) != new_data.HasStateFlag(state)) { 363 if (old_data.HasState(state) != new_data.HasState(state))
364 delegate_->OnStateChanged(this, node, state, 364 delegate_->OnStateChanged(this, node, state, new_data.HasState(state));
365 new_data.HasStateFlag(state));
366 }
367 } 365 }
368 } 366 }
369 367
370 auto string_callback = [this, node](AXStringAttribute attr, 368 auto string_callback = [this, node](AXStringAttribute attr,
371 const std::string& old_string, 369 const std::string& old_string,
372 const std::string& new_string) { 370 const std::string& new_string) {
373 delegate_->OnStringAttributeChanged(this, node, attr, old_string, 371 delegate_->OnStringAttributeChanged(this, node, attr, old_string,
374 new_string); 372 new_string);
375 }; 373 };
376 CallIfAttributeValuesChanged(old_data.string_attributes, 374 CallIfAttributeValuesChanged(old_data.string_attributes,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 update_state->pending_nodes.insert(child); 493 update_state->pending_nodes.insert(child);
496 update_state->new_nodes.insert(child); 494 update_state->new_nodes.insert(child);
497 } 495 }
498 new_children->push_back(child); 496 new_children->push_back(child);
499 } 497 }
500 498
501 return success; 499 return success;
502 } 500 }
503 501
504 } // namespace ui 502 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698