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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_view_state.h" 5 #include "ui/accessibility/ax_view_state.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 uint32_t AXViewState::AddStateFlag(uint32_t state, ui::AXState state_flag) {
10 state |= (1 << state_flag);
11 return state;
12 }
13
14 bool AXViewState::HasStateFlag(uint32_t state, ui::AXState state_flag) {
15 return 0 != (state & (1 << state_flag));
16 }
17
9 AXViewState::AXViewState() 18 AXViewState::AXViewState()
10 : role(AX_ROLE_CLIENT), 19 : role(AX_ROLE_CLIENT),
11 selection_start(-1), 20 selection_start(-1),
12 selection_end(-1), 21 selection_end(-1),
13 index(-1), 22 index(-1),
14 count(-1), 23 count(-1),
15 state_(0) { } 24 state_(0) { }
16 25
17 AXViewState::~AXViewState() { } 26 AXViewState::~AXViewState() { }
18 27
19 void AXViewState::AddStateFlag(ui::AXState state_flag) { 28 void AXViewState::AddStateFlag(ui::AXState state_flag) {
20 state_ |= (1 << state_flag); 29 state_ = AddStateFlag(state_, state_flag);
21 } 30 }
22 31
23 bool AXViewState::HasStateFlag(ui::AXState state_flag) const { 32 bool AXViewState::HasStateFlag(ui::AXState state_flag) const {
24 return 0 != (state_ & (1 << state_flag)); 33 return HasStateFlag(state_, state_flag);
25 } 34 }
26 35
27 } // namespace ui 36 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698