OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility.h" | 5 #include "content/browser/accessibility/browser_accessibility.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 bounds.Offset(-sx, -sy); | 1127 bounds.Offset(-sx, -sy); |
1128 } | 1128 } |
1129 } | 1129 } |
1130 | 1130 |
1131 node = container; | 1131 node = container; |
1132 } | 1132 } |
1133 | 1133 |
1134 return gfx::ToEnclosingRect(bounds); | 1134 return gfx::ToEnclosingRect(bounds); |
1135 } | 1135 } |
1136 | 1136 |
| 1137 // |
1137 // AXPlatformNodeDelegate. | 1138 // AXPlatformNodeDelegate. |
| 1139 // |
1138 const ui::AXNodeData& BrowserAccessibility::GetData() const { | 1140 const ui::AXNodeData& BrowserAccessibility::GetData() const { |
1139 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); | 1141 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); |
1140 if (node_) | 1142 if (node_) |
1141 return node_->data(); | 1143 return node_->data(); |
1142 else | 1144 else |
1143 return empty_data; | 1145 return empty_data; |
1144 } | 1146 } |
1145 | 1147 |
1146 gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() { | 1148 gfx::NativeWindow BrowserAccessibility::GetTopLevelWidget() { |
1147 NOTREACHED(); | 1149 NOTREACHED(); |
1148 return nullptr; | 1150 return nullptr; |
1149 } | 1151 } |
1150 | 1152 |
1151 gfx::NativeViewAccessible BrowserAccessibility::GetParent() { | 1153 gfx::NativeViewAccessible BrowserAccessibility::GetParent() { |
1152 NOTREACHED(); | 1154 auto* parent = PlatformGetParent(); |
| 1155 if (parent && parent->platform_node_) |
| 1156 return parent->platform_node_->GetNativeViewAccessible(); |
1153 return nullptr; | 1157 return nullptr; |
1154 } | 1158 } |
1155 | 1159 |
1156 int BrowserAccessibility::GetChildCount() { | 1160 int BrowserAccessibility::GetChildCount() { |
1157 NOTREACHED(); | 1161 return PlatformChildCount(); |
1158 return -1; | |
1159 } | 1162 } |
1160 | 1163 |
1161 gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) { | 1164 gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) { |
1162 NOTREACHED(); | 1165 auto* child = PlatformGetChild(index); |
| 1166 if (child && child->platform_node_) |
| 1167 return child->platform_node_->GetNativeViewAccessible(); |
1163 return nullptr; | 1168 return nullptr; |
1164 } | 1169 } |
1165 | 1170 |
1166 gfx::Rect BrowserAccessibility::GetScreenBoundsRect() const { | 1171 gfx::Rect BrowserAccessibility::GetScreenBoundsRect() const { |
1167 gfx::Rect bounds = GetPageBoundsRect(); | 1172 gfx::Rect bounds = GetPageBoundsRect(); |
1168 | 1173 |
1169 // Adjust the bounds by the top left corner of the containing view's bounds | 1174 // Adjust the bounds by the top left corner of the containing view's bounds |
1170 // in screen coordinates. | 1175 // in screen coordinates. |
1171 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); | 1176 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); |
1172 | 1177 |
(...skipping 16 matching lines...) Expand all Loading... |
1189 return gfx::kNullAcceleratedWidget; | 1194 return gfx::kNullAcceleratedWidget; |
1190 } | 1195 } |
1191 | 1196 |
1192 bool BrowserAccessibility::AccessibilityPerformAction( | 1197 bool BrowserAccessibility::AccessibilityPerformAction( |
1193 const ui::AXActionData& data) { | 1198 const ui::AXActionData& data) { |
1194 NOTREACHED(); | 1199 NOTREACHED(); |
1195 return false; | 1200 return false; |
1196 } | 1201 } |
1197 | 1202 |
1198 } // namespace content | 1203 } // namespace content |
OLD | NEW |