OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_ | |
6 #define CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "content/browser/accessibility/ax_tree_id_registry.h" | |
11 #include "content/browser/accessibility/browser_accessibility.h" | |
12 #include "ui/accessibility/ax_position.h" | |
13 | |
14 namespace content { | |
15 | |
16 using AXTreeID = content::AXTreeIDRegistry::AXTreeID; | |
17 | |
18 class AXPlatformPosition : public ui::AXPosition<BrowserAccessibility> { | |
19 public: | |
20 ~AXPlatformPosition() override; | |
21 | |
22 protected: | |
23 AXPlatformPosition(AXTreeID tree_id, | |
24 int32_t anchor_id, | |
25 int child_index, | |
26 int text_offset, | |
David Tseng
2016/10/07 21:02:41
Can you think of a way to combine text_offset and
| |
27 ui::AXPositionType type); | |
28 | |
29 int AnchorChildCount() const override { | |
David Tseng
2016/10/07 21:02:41
AXPosition<BrowserAccessibility> overrides
| |
30 return GetAnchor() ? static_cast<int>(GetAnchor()->PlatformChildCount()) | |
David Tseng
2016/10/07 21:02:41
This isn't a simple getter; put in .cc
| |
31 : -1; | |
David Tseng
2016/10/07 21:02:41
Name this special constant
| |
32 } | |
33 AXPosition* GetChildPositionAt(int child_index) const override; | |
34 AXPosition* GetParentPosition() const override; | |
35 int AnchorIndexInParent() const override { | |
36 return GetAnchor() ? static_cast<int>(GetAnchor()->GetIndexInParent()) : -1; | |
37 } | |
38 BrowserAccessibility* GetNodeInTree(AXTreeID tree_id, | |
39 int32_t node_id) const override; | |
40 int MaxTextOffset() const override; | |
41 }; | |
42 | |
43 } // namespace content | |
44 | |
45 #endif // CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_ | |
OLD | NEW |