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

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

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Review comments. 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 // Clear all bits in preparation for use of AXNodeData.
110 static bool IsFlagSet(uint32_t state, ui::AXState state_flag); 110 void Init();
dmazzoni 2017/05/08 04:28:26 Perhaps we should just put this in the constructor
Patti Lor 2017/05/08 07:44:47 I've deleted this Init() method and just set |stat
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
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_
OLDNEW
« no previous file with comments | « content/renderer/accessibility/blink_ax_tree_source.cc ('k') | ui/accessibility/ax_node_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698