| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // Setting accessibility attributes. | 92 // Setting accessibility attributes. |
| 93 void AddStringAttribute(AXStringAttribute attribute, | 93 void AddStringAttribute(AXStringAttribute attribute, |
| 94 const std::string& value); | 94 const std::string& value); |
| 95 void AddIntAttribute(AXIntAttribute attribute, int value); | 95 void AddIntAttribute(AXIntAttribute attribute, int value); |
| 96 void AddFloatAttribute(AXFloatAttribute attribute, float value); | 96 void AddFloatAttribute(AXFloatAttribute attribute, float value); |
| 97 void AddBoolAttribute(AXBoolAttribute attribute, bool value); | 97 void AddBoolAttribute(AXBoolAttribute attribute, bool value); |
| 98 void AddIntListAttribute(AXIntListAttribute attribute, | 98 void AddIntListAttribute(AXIntListAttribute attribute, |
| 99 const std::vector<int32_t>& value); | 99 const std::vector<int32_t>& value); |
| 100 | 100 |
| 101 // Validated setting of accessibility attributes. |
| 102 void AddValidatedIntAttribute(AXValidatedIntAttribute attribute, int value); |
| 103 |
| 101 // Convenience functions, mainly for writing unit tests. | 104 // Convenience functions, mainly for writing unit tests. |
| 102 // Equivalent to AddStringAttribute(ATTR_NAME, name). | 105 // Equivalent to AddStringAttribute(ATTR_NAME, name). |
| 103 void SetName(const std::string& name); | 106 void SetName(const std::string& name); |
| 104 void SetName(const base::string16& name); | 107 void SetName(const base::string16& name); |
| 105 // Equivalent to AddStringAttribute(ATTR_VALUE, value). | 108 // Equivalent to AddStringAttribute(ATTR_VALUE, value). |
| 106 void SetValue(const std::string& value); | 109 void SetValue(const std::string& value); |
| 107 void SetValue(const base::string16& value); | 110 void SetValue(const base::string16& value); |
| 108 | 111 |
| 109 // Helper to check whether |state_flag| is set in the given |state|. | 112 // Helper to check whether |state_flag| is set in the given |state|. |
| 110 static bool IsFlagSet(uint32_t state, ui::AXState state_flag); | 113 static bool IsFlagSet(uint32_t state, ui::AXState state_flag); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // NOTE: this member is a std::unique_ptr because it's rare and gfx::Transform | 147 // 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 | 148 // 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 | 149 // constructor both make a duplicate of the owned pointer, so it acts more |
| 147 // like a member than a pointer. | 150 // like a member than a pointer. |
| 148 std::unique_ptr<gfx::Transform> transform; | 151 std::unique_ptr<gfx::Transform> transform; |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace ui | 154 } // namespace ui |
| 152 | 155 |
| 153 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ | 156 #endif // UI_ACCESSIBILITY_AX_NODE_DATA_H_ |
| OLD | NEW |