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

Unified Diff: ui/accessibility/ax_node_position.h

Issue 2271893002: Creates AXPosition to uniquely identify a position in the accessibility tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a number of unit tests. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/accessibility/ax_node_position.h
diff --git a/ui/accessibility/ax_node_position.h b/ui/accessibility/ax_node_position.h
new file mode 100644
index 0000000000000000000000000000000000000000..965dc31d9b39fd90cbc66523f73ddc150f466ccb
--- /dev/null
+++ b/ui/accessibility/ax_node_position.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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_NODE_POSITION_H_
+#define UI_ACCESSIBILITY_AX_NODE_POSITION_H_
+
+#include <stdint.h>
+
+#include "ui/accessibility/ax_export.h"
+#include "ui/accessibility/ax_node.h"
+#include "ui/accessibility/ax_position.h"
+#include "ui/accessibility/ax_tree.h"
+
+namespace ui {
+
+class AX_EXPORT AXNodePosition : public AXPosition<AXNodePosition, AXNode> {
dmazzoni 2016/10/12 20:45:41 Is this intended only for testing? It can't really
+ public:
+ AXNodePosition();
+ ~AXNodePosition() override;
+
+ static void SetTreeForTesting(AXTree* tree) { tree_ = tree; }
+
+ protected:
+ int AnchorChildCount() const override;
+ AXNodePosition* GetChildPositionAt(int child_index) const override;
+ AXNodePosition* GetParentPosition() const override;
+ int AnchorIndexInParent() const override;
+ AXNode* GetNodeInTree(int tree_id, int32_t node_id) const override;
+ int MaxTextOffset() const override;
+
+ private:
+ static AXTree* tree_;
+};
+
+} // namespace ui
+
+#endif // UI_ACCESSIBILITY_AX_NODE_POSITION_H_

Powered by Google App Engine
This is Rietveld 408576698