Chromium Code Reviews| 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 <memory> | |
| 11 | |
| 12 #include "content/browser/accessibility/ax_tree_id_registry.h" | |
| 13 #include "content/browser/accessibility/browser_accessibility.h" | |
| 14 #include "content/browser/accessibility/browser_accessibility_manager.h" | |
| 15 #include "ui/accessibility/ax_node.h" | |
| 16 #include "ui/accessibility/ax_position.h" | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 class AXPlatformPositionFactory; | |
| 21 | |
| 22 class AXPlatformPosition : ui::AXPosition { | |
| 23 public: | |
| 24 ~AXPlatformPosition() override; | |
| 25 | |
| 26 protected: | |
| 27 friend class AXPlatformPositionFactory; | |
| 28 AXPlatformPosition(AXTreeIDRegistry::AXTreeID tree_id, | |
| 29 int32_t anchor_id, | |
| 30 int child_index, | |
| 31 int text_offset, | |
| 32 ui::AXPositionType type, | |
| 33 std::unique_ptr<ui::AXPositionFactory> factory = | |
|
dmazzoni
2016/10/04 20:08:24
It's not necessarily a bad idea to have an object
| |
| 34 std::make_unique<AXPlatformPositionFactory>()); | |
| 35 | |
| 36 BrowserAccessibility* GetPlatformNodeInTree( | |
| 37 AXTreeIDRegistry::AXTreeID tree_id, | |
| 38 int32_t node_id) const; | |
| 39 ui::AXNode* GetNodeInTree(AXTreeIDRegistry::AXTreeID tree_id, | |
| 40 int32_t node_id) const override; | |
| 41 int MaxTextOffset() const override; | |
| 42 }; | |
| 43 | |
| 44 class AXPlatformPositionFactory : ui::AXPositionFactory { | |
| 45 public: | |
| 46 virtual ~AXPlatformPositionFactory() {} | |
| 47 | |
| 48 ui::AXPosition CreateNullPosition() override; | |
| 49 ui::AXPosition CreateTreePosition(int tree_id, | |
| 50 int32_t anchor_id, | |
| 51 int child_index) override; | |
| 52 ui::AXPosition CreateTextPosition(int tree_id, | |
| 53 int32_t anchor_id, | |
| 54 int text_offset) override; | |
| 55 }; | |
| 56 | |
| 57 } // namespace content | |
| 58 | |
| 59 #endif // CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_ | |
| OLD | NEW |