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

Side by Side Diff: ui/accessibility/platform/test_ax_node_wrapper.cc

Issue 2948513002: Forward BrowserAccessibility::accHitTest to AXPlatformNode. (Closed)
Patch Set: Adjust the test to match the spec Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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 #include "ui/gfx/geometry/rect_conversions.h" 8 #include "ui/gfx/geometry/rect_conversions.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 nullptr; 105 nullptr;
106 } 106 }
107 107
108 gfx::Rect TestAXNodeWrapper::GetScreenBoundsRect() const { 108 gfx::Rect TestAXNodeWrapper::GetScreenBoundsRect() const {
109 gfx::RectF bounds = GetData().location; 109 gfx::RectF bounds = GetData().location;
110 bounds.Offset(g_offset); 110 bounds.Offset(g_offset);
111 return gfx::ToEnclosingRect(bounds); 111 return gfx::ToEnclosingRect(bounds);
112 } 112 }
113 113
114 gfx::NativeViewAccessible TestAXNodeWrapper::HitTestSync(int x, int y) { 114 gfx::NativeViewAccessible TestAXNodeWrapper::HitTestSync(int x, int y) {
115 return nullptr; 115 gfx::RectF bounds = GetData().location;
116 if (!bounds.Contains(x, y))
dmazzoni 2017/06/23 18:51:12 Let's have this iterate over children too, to do a
dougt 2017/06/25 21:16:32 SG. This impl isn't perfect and will not be able
117 return nullptr;
118
119 return ax_platform_node()->GetNativeViewAccessible();
116 } 120 }
117 121
118 gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() { 122 gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() {
119 return nullptr; 123 return nullptr;
120 } 124 }
121 125
122 gfx::AcceleratedWidget 126 gfx::AcceleratedWidget
123 TestAXNodeWrapper::GetTargetForNativeAccessibilityEvent() { 127 TestAXNodeWrapper::GetTargetForNativeAccessibilityEvent() {
124 return gfx::kNullAcceleratedWidget; 128 return gfx::kNullAcceleratedWidget;
125 } 129 }
126 130
127 bool TestAXNodeWrapper::AccessibilityPerformAction( 131 bool TestAXNodeWrapper::AccessibilityPerformAction(
128 const ui::AXActionData& data) { 132 const ui::AXActionData& data) {
129 return true; 133 return true;
130 } 134 }
131 135
132 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node) 136 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node)
133 : tree_(tree), 137 : tree_(tree),
134 node_(node), 138 node_(node),
135 platform_node_(AXPlatformNode::Create(this)) { 139 platform_node_(AXPlatformNode::Create(this)) {
136 } 140 }
137 141
138 } // namespace ui 142 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698