Chromium Code Reviews| 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 selection_start(-1), | 11 selection_start(-1), |
| 12 selection_end(-1), | 12 selection_end(-1), |
| 13 index(-1), | 13 index(-1), |
| 14 count(-1), | 14 count(-1), |
| 15 state_(0) { } | 15 state_(0) { } |
| 16 | 16 |
| 17 AXViewState::~AXViewState() { } | 17 AXViewState::~AXViewState() { } |
| 18 | 18 |
| 19 bool AXViewState::IsFlagSet(uint32_t state, ui::AXState state_flag) { | |
|
tapted
2016/06/17 03:32:49
nit: // static
Patti Lor
2016/06/17 05:57:35
Done.
| |
| 20 return 0 != (state & (1 << state_flag)); | |
| 21 } | |
| 22 | |
| 19 void AXViewState::AddStateFlag(ui::AXState state_flag) { | 23 void AXViewState::AddStateFlag(ui::AXState state_flag) { |
| 20 state_ |= (1 << state_flag); | 24 state_ |= (1 << state_flag); |
| 21 } | 25 } |
| 22 | 26 |
| 23 bool AXViewState::HasStateFlag(ui::AXState state_flag) const { | 27 bool AXViewState::HasStateFlag(ui::AXState state_flag) const { |
| 24 return 0 != (state_ & (1 << state_flag)); | 28 return IsFlagSet(state_, state_flag); |
| 25 } | 29 } |
| 26 | 30 |
| 27 } // namespace ui | 31 } // namespace ui |
| OLD | NEW |