OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_TREE_DATA_H_ | 5 #ifndef UI_ACCESSIBILITY_AX_TREE_DATA_H_ |
6 #define UI_ACCESSIBILITY_AX_TREE_DATA_H_ | 6 #define UI_ACCESSIBILITY_AX_TREE_DATA_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <string> | 11 #include <string> |
10 #include <vector> | 12 #include <vector> |
11 | 13 |
12 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
13 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
14 #include "ui/accessibility/ax_enums.h" | 16 #include "ui/accessibility/ax_enums.h" |
15 #include "ui/accessibility/ax_export.h" | 17 #include "ui/accessibility/ax_export.h" |
16 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
17 | 19 |
18 namespace ui { | 20 namespace ui { |
19 | 21 |
20 // The data associated with an accessibility tree that's global to the | 22 // The data associated with an accessibility tree that's global to the |
21 // tree and not associated with any particular node in the tree. | 23 // tree and not associated with any particular node in the tree. |
22 struct AX_EXPORT AXTreeData { | 24 struct AX_EXPORT AXTreeData { |
23 AXTreeData(); | 25 AXTreeData(); |
24 virtual ~AXTreeData(); | 26 virtual ~AXTreeData(); |
25 | 27 |
26 // Return a string representation of this data, for debugging. | 28 // Return a string representation of this data, for debugging. |
27 virtual std::string ToString() const; | 29 virtual std::string ToString() const; |
28 | 30 |
29 // This is a simple serializable struct. All member variables should be | 31 // This is a simple serializable struct. All member variables should be |
30 // public and copyable. | 32 // public and copyable. |
31 | 33 |
32 // The globally unique ID of this accessibility tree. | 34 // The globally unique ID of this accessibility tree. |
33 int32 tree_id; | 35 int32_t tree_id; |
34 | 36 |
35 // The ID of the accessibility tree that this tree is contained in, if any. | 37 // The ID of the accessibility tree that this tree is contained in, if any. |
36 int32 parent_tree_id; | 38 int32_t parent_tree_id; |
37 | 39 |
38 // Attributes specific to trees that are web frames. | 40 // Attributes specific to trees that are web frames. |
39 std::string url; | 41 std::string url; |
40 std::string title; | 42 std::string title; |
41 std::string mimetype; | 43 std::string mimetype; |
42 std::string doctype; | 44 std::string doctype; |
43 bool loaded; | 45 bool loaded; |
44 float loading_progress; | 46 float loading_progress; |
45 | 47 |
46 // The current text selection within this tree, if any, expressed as the | 48 // The current text selection within this tree, if any, expressed as the |
47 // node ID and character offset of the anchor (selection start) and focus | 49 // node ID and character offset of the anchor (selection start) and focus |
48 // (selection end). | 50 // (selection end). |
49 int32 sel_anchor_object_id; | 51 int32_t sel_anchor_object_id; |
50 int32 sel_anchor_offset; | 52 int32_t sel_anchor_offset; |
51 int32 sel_focus_object_id; | 53 int32_t sel_focus_object_id; |
52 int32 sel_focus_offset; | 54 int32_t sel_focus_offset; |
53 }; | 55 }; |
54 | 56 |
55 AX_EXPORT bool operator==(const AXTreeData& lhs, const AXTreeData& rhs); | 57 AX_EXPORT bool operator==(const AXTreeData& lhs, const AXTreeData& rhs); |
56 AX_EXPORT bool operator!=(const AXTreeData& lhs, const AXTreeData& rhs); | 58 AX_EXPORT bool operator!=(const AXTreeData& lhs, const AXTreeData& rhs); |
57 | 59 |
58 } // namespace ui | 60 } // namespace ui |
59 | 61 |
60 #endif // UI_ACCESSIBILITY_AX_TREE_DATA_H_ | 62 #endif // UI_ACCESSIBILITY_AX_TREE_DATA_H_ |
OLD | NEW |