Index: ui/accessibility/ax_position.h |
diff --git a/ui/accessibility/ax_position.h b/ui/accessibility/ax_position.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..293b23e36f11d70f0880e025819327714885ce4f |
--- /dev/null |
+++ b/ui/accessibility/ax_position.h |
@@ -0,0 +1,35 @@ |
+// 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_POSITION_H_ |
dmazzoni
2016/08/10 20:45:52
Looks cool but doesn't belong in this change?
|
+#define UI_ACCESSIBILITY_AX_POSITION_H_ |
+ |
+#include "ui/accessibility/ax_node.h" |
+ |
+namespace ui { |
+ |
+// A position in the |AXTree|. |
+class AX_EXPORT AXPosition { |
+ public: |
+ AXPosition(); |
+ AXPosition(AXNode* anchor, int offset); |
+ virtual ~AXPosition(); |
+ |
+ static AXPosition* CreateNullPosition(); |
+ |
+ AXNode* get_anchor() const { return anchor_; } |
+ int get_offset() const { return offset_; } |
+ |
+ bool IsNull() const; |
+ AXPosition ToLeafEquivalent() const; |
+ AXPosition GetCorrespondingPositionInParent(const AXNode& parent) const; |
+ |
+ private: |
+ AXNode* anchor_; |
+ int offset_; |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_ACCESSIBILITY_AX_POSITION_H_ |