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

Unified Diff: ui/accessibility/ax_tree_update.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: Git rid of AX_EXPORT from templatized function 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
« no previous file with comments | « ui/accessibility/ax_tree_unittest.cc ('k') | ui/accessibility/ax_tree_update.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_tree_update.h
diff --git a/ui/accessibility/ax_tree_update.h b/ui/accessibility/ax_tree_update.h
new file mode 100644
index 0000000000000000000000000000000000000000..e0584d10925acb9a8921bb99114dd2dbc376214a
--- /dev/null
+++ b/ui/accessibility/ax_tree_update.h
@@ -0,0 +1,45 @@
+// 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 UI_ACCESSIBILITY_AX_TREE_UPDATE_H_
+#define UI_ACCESSIBILITY_AX_TREE_UPDATE_H_
+
+#include <vector>
+
+#include "ui/accessibility/ax_node_data.h"
+
+namespace ui {
+
+// An AXTreeUpdate is a serialized representation of an atomic change
+// to an AXTree. The sender and receiver must be in sync; the update
+// is only meant to bring the tree from a specific previous state into
+// its next state. Trying to apply it to the wrong tree should immediately
+// die with a fatal assertion. An AXTreeUpdate is just an ordered vector
+// of AXNodeData structures to be applied to the tree in order.
+//
+// Suppose that the next AXNodeData to be applied is |node|. The following
+// invariants must hold:
+// 1. Either |node.id| is already in the tree, or else |node| is the new
+// root of the tree and |node.role| == WebAXRoleRootWebArea.
+// 2. Every child id in |node.child_ids| must either be already a child
+// of this node, or a new id not previously in the tree. It is not
+// allowed to "reparent" a child to this node without first removing
+// that child from its previous parent.
+// 3. When a new id appears in |node.child_ids|, the tree should create a
+// new uninitialized placeholder node for it immediately. That
+// placeholder must be updated within the same AXTreeUpdate, otherwise
+// it's a fatal error. This guarantees the tree is always complete
+// before or after an AXTreeUpdate.
+struct AX_EXPORT AXTreeUpdate {
+ AXTreeUpdate();
+ ~AXTreeUpdate();
+
+ std::vector<AXNodeData> nodes;
+
+ // TODO(dmazzoni): location changes
+};
+
+} // namespace ui
+
+#endif // UI_ACCESSIBILITY_AX_TREE_UPDATE_H_
« no previous file with comments | « ui/accessibility/ax_tree_unittest.cc ('k') | ui/accessibility/ax_tree_update.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698