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

Unified Diff: content/public/common/ax_node_data.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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/ax_node_data.h
diff --git a/content/common/accessibility_node_data.h b/content/public/common/ax_node_data.h
similarity index 78%
copy from content/common/accessibility_node_data.h
copy to content/public/common/ax_node_data.h
index c0c07662b20dc952f9fb0ea15786636e50a5ec1c..c9eb9ad86c38b3cfd1212dd34920588617d0265d 100644
--- a/content/common/accessibility_node_data.h
+++ b/content/public/common/ax_node_data.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_
-#define CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_
+#ifndef CONTENT_PUBLIC_COMMON_AX_NODE_DATA_H_
+#define CONTENT_PUBLIC_COMMON_AX_NODE_DATA_H_
#include <map>
#include <string>
@@ -18,8 +18,8 @@ namespace content {
// A compact representation of the accessibility information for a
// single web object, in a form that can be serialized and sent from
-// the renderer process to the browser process.
-struct CONTENT_EXPORT AccessibilityNodeData {
+// one process to another.
+struct CONTENT_EXPORT AXNodeData {
// Additional optional attributes that can be optionally attached to
// a node.
enum StringAttribute {
@@ -164,8 +164,8 @@ struct CONTENT_EXPORT AccessibilityNodeData {
ATTR_WORD_ENDS,
};
- AccessibilityNodeData();
- virtual ~AccessibilityNodeData();
+ AXNodeData();
+ virtual ~AXNodeData();
void AddStringAttribute(StringAttribute attribute,
const std::string& value);
@@ -181,10 +181,6 @@ struct CONTENT_EXPORT AccessibilityNodeData {
// Equivalent to AddStringAttribute(ATTR_VALUE, value).
void SetValue(std::string value);
- #ifndef NDEBUG
- virtual std::string DebugString(bool recursive) const;
- #endif
-
// This is a simple serializable struct. All member variables should be
// public and copyable.
int32 id;
@@ -201,33 +197,6 @@ struct CONTENT_EXPORT AccessibilityNodeData {
std::vector<int32> child_ids;
};
-// For testing and debugging only: this subclass of AccessibilityNodeData
-// is used to represent a whole tree of accessibility nodes, where each
-// node owns its children. This makes it easy to print the tree structure
-// or search it recursively.
-struct CONTENT_EXPORT AccessibilityNodeDataTreeNode
- : public AccessibilityNodeData {
- AccessibilityNodeDataTreeNode();
- virtual ~AccessibilityNodeDataTreeNode();
-
- AccessibilityNodeDataTreeNode& operator=(const AccessibilityNodeData& src);
-
- #ifndef NDEBUG
- virtual std::string DebugString(bool recursive) const OVERRIDE;
- #endif
-
- std::vector<AccessibilityNodeDataTreeNode> children;
-};
-
-// Given a vector of accessibility nodes that represent a complete
-// accessibility tree, where each node appears before its children,
-// build a tree of AccessibilityNodeDataTreeNode objects for easier
-// testing and debugging, where each node contains its children.
-// The |dst| argument will become the root of the new tree.
-void MakeAccessibilityNodeDataTree(
- const std::vector<AccessibilityNodeData>& src,
- AccessibilityNodeDataTreeNode* dst);
-
} // namespace content
-#endif // CONTENT_COMMON_ACCESSIBILITY_NODE_DATA_H_
+#endif // CONTENT_PUBLIC_COMMON_AX_NODE_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698