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

Side by Side Diff: content/common/ax_tree_source.h

Issue 67283004: First step to move common accessibility code out of content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored AXTreeImpl::UpdateNode Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_AX_TREE_SOURCE_H_
6 #define CONTENT_COMMON_AX_TREE_SOURCE_H_
7
8 #include "content/public/common/ax_node_data.h"
9
10 namespace content {
11
12 // An AXTreeSource is an abstract interface for a serializable
13 // accessibility tree. The tree may be in some other format or
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
16 // of the accessibility information about a node can be serialized
17 // as an AXNodeData. This is the primary interface to use when
18 // an accessibility tree will be sent over an IPC before being
19 // consumed.
20 template<class AXSourceNode>
David Tseng 2013/11/13 18:00:07 AXNodeSource
dmazzoni 2013/11/13 19:35:59 Done.
21 class CONTENT_EXPORT AXTreeSource {
22 public:
23 AXTreeSource() {}
David Tseng 2013/11/13 18:00:07 These should probably be protected.
dmazzoni 2013/11/13 19:35:59 Done.
24 virtual ~AXTreeSource() {}
25
26 virtual AXSourceNode* GetRoot() const = 0;
David Tseng 2013/11/13 18:00:07 Do you need GetRoot*? If not, this class could be
dmazzoni 2013/11/13 19:35:59 Not currently used so I deleted it. I think it is
27 virtual int32 GetRootId() const = 0;
28 virtual AXSourceNode* GetFromId(int32 id) const = 0;
29 virtual int32 GetId(const AXSourceNode* node) const = 0;
30 virtual int GetChildCount(const AXSourceNode* node) const = 0;
31 virtual AXSourceNode* GetChildAtIndex(const AXSourceNode* node, int index)
32 const = 0;
33
34 // Returns the id of this node's parent, or 0 if it doesn't have a parent.
35 virtual int32 GetParentId(const AXSourceNode* node) const = 0;
36
37 // Serialize one node in the tree.
38 virtual void SerializeNode(
39 const AXSourceNode* node, AXNodeData* out_data) const = 0;
40 };
41
42 } // namespace content
43
44 #endif // CONTENT_COMMON_AX_TREE_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698