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

Unified Diff: ui/accessibility/ax_view_state.cc

Issue 2016243002: Mac a11y: Add RoleDescription and Value attributes to accessibility information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 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: ui/accessibility/ax_view_state.cc
diff --git a/ui/accessibility/ax_view_state.cc b/ui/accessibility/ax_view_state.cc
index 11044bc16dd05304e96441b33641153621637a0a..989af5b9e1be354f4b75a44edd0b0c2075473119 100644
--- a/ui/accessibility/ax_view_state.cc
+++ b/ui/accessibility/ax_view_state.cc
@@ -6,6 +6,15 @@
namespace ui {
+uint32_t AXViewState::AddStateFlag(uint32_t state, ui::AXState state_flag) {
+ state |= (1 << state_flag);
+ return state;
+}
+
+bool AXViewState::HasStateFlag(uint32_t state, ui::AXState state_flag) {
+ return 0 != (state & (1 << state_flag));
+}
+
AXViewState::AXViewState()
: role(AX_ROLE_CLIENT),
selection_start(-1),
@@ -17,11 +26,11 @@ AXViewState::AXViewState()
AXViewState::~AXViewState() { }
void AXViewState::AddStateFlag(ui::AXState state_flag) {
- state_ |= (1 << state_flag);
+ state_ = AddStateFlag(state_, state_flag);
}
bool AXViewState::HasStateFlag(ui::AXState state_flag) const {
- return 0 != (state_ & (1 << state_flag));
+ return HasStateFlag(state_, state_flag);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698