| 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 #include "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
| 6 #include "ui/accessibility/ax_action_data.h" | 6 #include "ui/accessibility/ax_action_data.h" |
| 7 #include "ui/accessibility/platform/test_ax_node_wrapper.h" | 7 #include "ui/accessibility/platform/test_ax_node_wrapper.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 gfx::NativeViewAccessible TestAXNodeWrapper::ChildAtIndex(int index) { | 93 gfx::NativeViewAccessible TestAXNodeWrapper::ChildAtIndex(int index) { |
| 94 CHECK_GE(index, 0); | 94 CHECK_GE(index, 0); |
| 95 CHECK_LT(index, GetChildCount()); | 95 CHECK_LT(index, GetChildCount()); |
| 96 TestAXNodeWrapper* child_wrapper = | 96 TestAXNodeWrapper* child_wrapper = |
| 97 GetOrCreate(tree_, node_->children()[index]); | 97 GetOrCreate(tree_, node_->children()[index]); |
| 98 return child_wrapper ? | 98 return child_wrapper ? |
| 99 child_wrapper->ax_platform_node()->GetNativeViewAccessible() : | 99 child_wrapper->ax_platform_node()->GetNativeViewAccessible() : |
| 100 nullptr; | 100 nullptr; |
| 101 } | 101 } |
| 102 | 102 |
| 103 gfx::Vector2d TestAXNodeWrapper::GetGlobalCoordinateOffset() { | 103 gfx::Rect TestAXNodeWrapper::GetScreenBoundsRect() const { |
| 104 return g_offset; | 104 // The tests using this wrapper just care about the screen offset. |
| 105 return gfx::Rect(g_offset.x(), g_offset.y(), 0, 0); |
| 105 } | 106 } |
| 106 | 107 |
| 107 gfx::NativeViewAccessible TestAXNodeWrapper::HitTestSync(int x, int y) { | 108 gfx::NativeViewAccessible TestAXNodeWrapper::HitTestSync(int x, int y) { |
| 108 return nullptr; | 109 return nullptr; |
| 109 } | 110 } |
| 110 | 111 |
| 111 gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() { | 112 gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() { |
| 112 return nullptr; | 113 return nullptr; |
| 113 } | 114 } |
| 114 | 115 |
| 115 gfx::AcceleratedWidget | 116 gfx::AcceleratedWidget |
| 116 TestAXNodeWrapper::GetTargetForNativeAccessibilityEvent() { | 117 TestAXNodeWrapper::GetTargetForNativeAccessibilityEvent() { |
| 117 return gfx::kNullAcceleratedWidget; | 118 return gfx::kNullAcceleratedWidget; |
| 118 } | 119 } |
| 119 | 120 |
| 120 bool TestAXNodeWrapper::AccessibilityPerformAction( | 121 bool TestAXNodeWrapper::AccessibilityPerformAction( |
| 121 const ui::AXActionData& data) { | 122 const ui::AXActionData& data) { |
| 122 return true; | 123 return true; |
| 123 } | 124 } |
| 124 | 125 |
| 125 void TestAXNodeWrapper::DoDefaultAction() {} | 126 void TestAXNodeWrapper::DoDefaultAction() {} |
| 126 | 127 |
| 127 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node) | 128 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node) |
| 128 : tree_(tree), | 129 : tree_(tree), |
| 129 node_(node), | 130 node_(node), |
| 130 platform_node_(AXPlatformNode::Create(this)) { | 131 platform_node_(AXPlatformNode::Create(this)) { |
| 131 } | 132 } |
| 132 | 133 |
| 133 } // namespace ui | 134 } // namespace ui |
| OLD | NEW |