Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 5 #ifndef UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
| 6 #define UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 6 #define UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 const std::vector<int32_t>& value); | 99 const std::vector<int32_t>& value); |
| 100 | 100 |
| 101 // Convenience functions, mainly for writing unit tests. | 101 // Convenience functions, mainly for writing unit tests. |
| 102 // Equivalent to AddStringAttribute(ATTR_NAME, name). | 102 // Equivalent to AddStringAttribute(ATTR_NAME, name). |
| 103 void SetName(const std::string& name); | 103 void SetName(const std::string& name); |
| 104 void SetName(const base::string16& name); | 104 void SetName(const base::string16& name); |
| 105 // Equivalent to AddStringAttribute(ATTR_VALUE, value). | 105 // Equivalent to AddStringAttribute(ATTR_VALUE, value). |
| 106 void SetValue(const std::string& value); | 106 void SetValue(const std::string& value); |
| 107 void SetValue(const base::string16& value); | 107 void SetValue(const base::string16& value); |
| 108 | 108 |
| 109 // Helper to check whether |state_flag| is set in the given |state|. | 109 // Clear all bits in preparation for use of AXNodeData. |
| 110 static bool IsFlagSet(uint32_t state, ui::AXState state_flag); | 110 void ClearBitfields(); |
|
tapted
2017/05/05 05:53:36
I feel like this should be called InitState() or P
Patti Lor
2017/05/08 00:28:08
Renamed to Init() for now, will link owners this c
| |
| 111 | 111 // Set or check bits in |state|. |
| 112 // Set or check bits in |state_|. | 112 bool HasState(ui::AXState state_flag) const; |
| 113 void AddStateFlag(ui::AXState state_flag); | 113 void AddState(ui::AXState state_flag); |
| 114 bool HasStateFlag(ui::AXState state_flag) const; | |
| 115 | 114 |
| 116 // Return a string representation of this data, for debugging. | 115 // Return a string representation of this data, for debugging. |
| 117 virtual std::string ToString() const; | 116 virtual std::string ToString() const; |
| 118 | 117 |
| 119 // As much as possible this should behave as a simple, serializable, | 118 // As much as possible this should behave as a simple, serializable, |
| 120 // copyable struct. | 119 // copyable struct. |
| 121 int32_t id; | 120 int32_t id; |
| 122 AXRole role; | 121 AXRole role; |
| 123 uint32_t state; | 122 uint32_t state; |
| 124 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes; | 123 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 144 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform | 143 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform |
| 145 // takes up a fair amount of space. The assignment operator and copy | 144 // takes up a fair amount of space. The assignment operator and copy |
| 146 // constructor both make a duplicate of the owned pointer, so it acts more | 145 // constructor both make a duplicate of the owned pointer, so it acts more |
| 147 // like a member than a pointer. | 146 // like a member than a pointer. |
| 148 std::unique_ptr<gfx::Transform> transform; | 147 std::unique_ptr<gfx::Transform> transform; |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 } // namespace ui | 150 } // namespace ui |
| 152 | 151 |
| 153 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 152 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
| OLD | NEW |