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

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

Issue 1413423003: Move some AX attrs from AXNodeData to AXTreeData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « ui/accessibility/ax_tree_serializer_unittest.cc ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TREE_SOURCE_H_ 5 #ifndef UI_ACCESSIBILITY_AX_TREE_SOURCE_H_
6 #define UI_ACCESSIBILITY_AX_TREE_SOURCE_H_ 6 #define UI_ACCESSIBILITY_AX_TREE_SOURCE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 namespace ui { 10 namespace ui {
11 11
12 // An AXTreeSource is an abstract interface for a serializable 12 // An AXTreeSource is an abstract interface for a serializable
13 // accessibility tree. The tree may be in some other format or 13 // accessibility tree. The tree may be in some other format or
14 // may be computed dynamically, but maintains the properties that 14 // may be computed dynamically, but maintains the properties that
15 // it's a strict tree, it has a unique id for each node, and all 15 // it's a strict tree, it has a unique id for each node, and all
16 // of the accessibility information about a node can be serialized 16 // of the accessibility information about a node can be serialized
17 // as an AXNodeData. This is the primary interface to use when 17 // as an AXNodeData. This is the primary interface to use when
18 // an accessibility tree will be sent over an IPC before being 18 // an accessibility tree will be sent over an IPC before being
19 // consumed. 19 // consumed.
20 template<typename AXNodeSource, typename AXNodeData> 20 template<typename AXNodeSource, typename AXNodeData, typename AXTreeData>
21 class AXTreeSource { 21 class AXTreeSource {
22 public: 22 public:
23 virtual ~AXTreeSource() {} 23 virtual ~AXTreeSource() {}
24 24
25 // Get the tree data.
26 virtual AXTreeData GetTreeData() const = 0;
27
25 // Get the root of the tree. 28 // Get the root of the tree.
26 virtual AXNodeSource GetRoot() const = 0; 29 virtual AXNodeSource GetRoot() const = 0;
27 30
28 // Get a node by its id. If no node by that id exists in the tree, return a 31 // Get a node by its id. If no node by that id exists in the tree, return a
29 // null node, i.e. one that will return false if you call IsValid on it. 32 // null node, i.e. one that will return false if you call IsValid on it.
30 virtual AXNodeSource GetFromId(int32 id) const = 0; 33 virtual AXNodeSource GetFromId(int32 id) const = 0;
31 34
32 // Return the id of a node. All ids must be positive integers. 35 // Return the id of a node. All ids must be positive integers.
33 virtual int32 GetId(AXNodeSource node) const = 0; 36 virtual int32 GetId(AXNodeSource node) const = 0;
34 37
(...skipping 18 matching lines...) Expand all
53 // Serialize one node in the tree. 56 // Serialize one node in the tree.
54 virtual void SerializeNode(AXNodeSource node, AXNodeData* out_data) const = 0; 57 virtual void SerializeNode(AXNodeSource node, AXNodeData* out_data) const = 0;
55 58
56 protected: 59 protected:
57 AXTreeSource() {} 60 AXTreeSource() {}
58 }; 61 };
59 62
60 } // namespace ui 63 } // namespace ui
61 64
62 #endif // UI_ACCESSIBILITY_AX_TREE_SOURCE_H_ 65 #endif // UI_ACCESSIBILITY_AX_TREE_SOURCE_H_
OLDNEW
« no previous file with comments | « ui/accessibility/ax_tree_serializer_unittest.cc ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698