| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ | 5 #ifndef UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ |
| 6 #define UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ | 6 #define UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "ui/accessibility/ax_node.h" | 8 #include "ui/accessibility/ax_node.h" |
| 9 #include "ui/accessibility/ax_tree.h" | 9 #include "ui/accessibility/ax_tree.h" |
| 10 #include "ui/accessibility/platform/ax_platform_node.h" | 10 #include "ui/accessibility/platform/ax_platform_node.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // you also want to implement AXTreeDelegate. | 21 // you also want to implement AXTreeDelegate. |
| 22 static TestAXNodeWrapper* GetOrCreate(AXTree* tree, AXNode* node); | 22 static TestAXNodeWrapper* GetOrCreate(AXTree* tree, AXNode* node); |
| 23 | 23 |
| 24 // Set a global coordinate offset for testing. | 24 // Set a global coordinate offset for testing. |
| 25 static void SetGlobalCoordinateOffset(const gfx::Vector2d& offset); | 25 static void SetGlobalCoordinateOffset(const gfx::Vector2d& offset); |
| 26 | 26 |
| 27 virtual ~TestAXNodeWrapper(); | 27 virtual ~TestAXNodeWrapper(); |
| 28 | 28 |
| 29 AXPlatformNode* ax_platform_node() { return platform_node_; } | 29 AXPlatformNode* ax_platform_node() { return platform_node_; } |
| 30 | 30 |
| 31 void BuildAllWrappers(AXTree* tree, AXNode* node); |
| 32 |
| 31 // AXPlatformNodeDelegate. | 33 // AXPlatformNodeDelegate. |
| 32 const AXNodeData& GetData() const override; | 34 const AXNodeData& GetData() const override; |
| 33 const ui::AXTreeData& GetTreeData() const override; | 35 const ui::AXTreeData& GetTreeData() const override; |
| 34 gfx::NativeWindow GetTopLevelWidget() override; | 36 gfx::NativeWindow GetTopLevelWidget() override; |
| 35 gfx::NativeViewAccessible GetParent() override; | 37 gfx::NativeViewAccessible GetParent() override; |
| 36 int GetChildCount() override; | 38 int GetChildCount() override; |
| 37 gfx::NativeViewAccessible ChildAtIndex(int index) override; | 39 gfx::NativeViewAccessible ChildAtIndex(int index) override; |
| 38 gfx::Rect GetScreenBoundsRect() const override; | 40 gfx::Rect GetScreenBoundsRect() const override; |
| 39 gfx::NativeViewAccessible HitTestSync(int x, int y) override; | 41 gfx::NativeViewAccessible HitTestSync(int x, int y) override; |
| 40 gfx::NativeViewAccessible GetFocus() override; | 42 gfx::NativeViewAccessible GetFocus() override; |
| 41 ui::AXPlatformNode* GetFromNodeID(int32_t id) override; | 43 ui::AXPlatformNode* GetFromNodeID(int32_t id) override; |
| 42 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; | 44 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override; |
| 43 bool AccessibilityPerformAction(const ui::AXActionData& data) override; | 45 bool AccessibilityPerformAction(const ui::AXActionData& data) override; |
| 44 bool ShouldIgnoreHoveredStateForTesting() override; | 46 bool ShouldIgnoreHoveredStateForTesting() override; |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 TestAXNodeWrapper(AXTree* tree, AXNode* node); | 49 TestAXNodeWrapper(AXTree* tree, AXNode* node); |
| 48 | 50 |
| 49 TestAXNodeWrapper* HitTestSyncInternal(int x, int y); | 51 TestAXNodeWrapper* HitTestSyncInternal(int x, int y); |
| 50 | 52 |
| 51 AXTree* tree_; | 53 AXTree* tree_; |
| 52 AXNode* node_; | 54 AXNode* node_; |
| 53 AXPlatformNode* platform_node_; | 55 AXPlatformNode* platform_node_; |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 } // namespace ui | 58 } // namespace ui |
| 57 | 59 |
| 58 #endif // UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ | 60 #endif // UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_ |
| OLD | NEW |