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

Side by Side Diff: ui/accessibility/ax_node_data.h

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. Created 3 years, 7 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 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
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 // Set or check bits in |state|.
110 static bool IsFlagSet(uint32_t state, ui::AXState state_flag); 110 bool HasState(ui::AXState state_flag) const;
111 111 void AddState(ui::AXState state_flag);
112 // Set or check bits in |state_|.
113 void AddStateFlag(ui::AXState state_flag);
114 bool HasStateFlag(ui::AXState state_flag) const;
115 112
116 // Return a string representation of this data, for debugging. 113 // Return a string representation of this data, for debugging.
117 virtual std::string ToString() const; 114 virtual std::string ToString() const;
118 115
119 // As much as possible this should behave as a simple, serializable, 116 // As much as possible this should behave as a simple, serializable,
120 // copyable struct. 117 // copyable struct.
121 int32_t id; 118 int32_t id;
122 AXRole role; 119 AXRole role;
123 uint32_t state; 120 uint32_t state;
124 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes; 121 std::vector<std::pair<AXStringAttribute, std::string>> string_attributes;
(...skipping 19 matching lines...) Expand all
144 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform 141 // 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 142 // 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 143 // constructor both make a duplicate of the owned pointer, so it acts more
147 // like a member than a pointer. 144 // like a member than a pointer.
148 std::unique_ptr<gfx::Transform> transform; 145 std::unique_ptr<gfx::Transform> transform;
149 }; 146 };
150 147
151 } // namespace ui 148 } // namespace ui
152 149
153 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ 150 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698