OLD | NEW |
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 AXViewState::AXViewState() | 9 AXViewState::AXViewState() |
10 : role(AX_ROLE_CLIENT), | 10 : role(AX_ROLE_CLIENT), |
11 state(0), | 11 state(0), |
12 selection_start(-1), | 12 selection_start(-1), |
13 selection_end(-1), | 13 selection_end(-1), |
14 index(-1), | 14 index(-1), |
15 count(-1) { } | 15 count(-1) { } |
16 | 16 |
17 AXViewState::~AXViewState() { } | 17 AXViewState::~AXViewState() { } |
18 | 18 |
| 19 void AXViewState::SetStateFlag(ui::AXState state_flag) { |
| 20 state |= (1 << state_flag); |
| 21 } |
| 22 |
| 23 bool AXViewState::HasStateFlag(ui::AXState state_flag) const { |
| 24 return 0 != (state & (1 << state_flag)); |
| 25 } |
| 26 |
19 } // namespace ui | 27 } // namespace ui |
OLD | NEW |