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

Unified Diff: ui/accessibility/platform/test_ax_node_wrapper.h

Issue 909143003: Re-land: Implement NativeViewAccessibilityWin using AXPlatformNodeWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update GN build Created 5 years, 10 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/platform/test_ax_node_wrapper.h
diff --git a/ui/accessibility/platform/test_ax_node_wrapper.h b/ui/accessibility/platform/test_ax_node_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..918b4e3aca3c5d56724b19e71ec0fe3e27489368
--- /dev/null
+++ b/ui/accessibility/platform/test_ax_node_wrapper.h
@@ -0,0 +1,53 @@
+// Copyright 2015 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_PLATFORM_TEST_AX_NODE_WRAPPER_H_
+#define UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_
+
+#include "ui/accessibility/ax_node.h"
+#include "ui/accessibility/ax_tree.h"
+#include "ui/accessibility/platform/ax_platform_node.h"
+#include "ui/accessibility/platform/ax_platform_node_delegate.h"
+
+namespace ui {
+
+// For testing, a TestAXNodeWrapper wraps an AXNode, implements
+// AXPlatformNodeDelegate, and owns an AXPlatformNode.
+class TestAXNodeWrapper : public AXPlatformNodeDelegate {
+ public:
+ // Create TestAXNodeWrapper instances on-demand from an AXTree and AXNode.
+ // Note that this sets the AXTreeDelegate, you can't use this class if
+ // you also want to implement AXTreeDelegate.
+ static TestAXNodeWrapper* GetOrCreate(AXTree* tree, AXNode* node);
+
+ // Set a global coordinate offset for testing.
+ static void SetGlobalCoordinateOffset(const gfx::Vector2d& offset);
+
+ virtual ~TestAXNodeWrapper();
+
+ AXPlatformNode* ax_platform_node() { return platform_node_; }
+
+ // AXPlatformNodeDelegate.
+ const AXNodeData& GetData() override;
+ gfx::NativeViewAccessible GetParent() override;
+ int GetChildCount() override;
+ gfx::NativeViewAccessible ChildAtIndex(int index) override;
+ gfx::Vector2d GetGlobalCoordinateOffset() override;
+ gfx::NativeViewAccessible HitTestSync(int x, int y) override;
+ gfx::NativeViewAccessible GetFocus() override;
+ gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override;
+ void DoDefaultAction() override;
+ bool SetStringValue(const base::string16& new_value) override;
+
+ private:
+ TestAXNodeWrapper(AXTree* tree, AXNode* node);
+
+ AXTree* tree_;
+ AXNode* node_;
+ AXPlatformNode* platform_node_;
+};
+
+} // namespace ui
+
+#endif // UI_ACCESSIBILITY_PLATFORM_TEST_AX_NODE_WRAPPER_H_
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_win_unittest.cc ('k') | ui/accessibility/platform/test_ax_node_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698