| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 gfx::Rect bounds = GetPageBoundsRect(); | 1123 gfx::Rect bounds = GetPageBoundsRect(); |
| 1124 | 1124 |
| 1125 // Adjust the bounds by the top left corner of the containing view's bounds | 1125 // Adjust the bounds by the top left corner of the containing view's bounds |
| 1126 // in screen coordinates. | 1126 // in screen coordinates. |
| 1127 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); | 1127 bounds.Offset(manager_->GetViewBounds().OffsetFromOrigin()); |
| 1128 | 1128 |
| 1129 return bounds; | 1129 return bounds; |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 gfx::NativeViewAccessible BrowserAccessibility::HitTestSync(int x, int y) { | 1132 gfx::NativeViewAccessible BrowserAccessibility::HitTestSync(int x, int y) { |
| 1133 NOTREACHED(); | 1133 auto* accessible = manager_->CachingAsyncHitTest(gfx::Point(x, y)); |
| 1134 return nullptr; | 1134 if (!accessible) |
| 1135 return nullptr; |
| 1136 |
| 1137 return accessible->GetNativeViewAccessible(); |
| 1135 } | 1138 } |
| 1136 | 1139 |
| 1137 gfx::NativeViewAccessible BrowserAccessibility::GetFocus() { | 1140 gfx::NativeViewAccessible BrowserAccessibility::GetFocus() { |
| 1138 auto* focused = manager()->GetFocus(); | 1141 auto* focused = manager()->GetFocus(); |
| 1139 if (!focused) | 1142 if (!focused) |
| 1140 return nullptr; | 1143 return nullptr; |
| 1141 | 1144 |
| 1142 return focused->GetNativeViewAccessible(); | 1145 return focused->GetNativeViewAccessible(); |
| 1143 } | 1146 } |
| 1144 | 1147 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1160 | 1163 |
| 1161 if (data.action == ui::AX_ACTION_FOCUS) { | 1164 if (data.action == ui::AX_ACTION_FOCUS) { |
| 1162 manager_->SetFocus(*this); | 1165 manager_->SetFocus(*this); |
| 1163 return true; | 1166 return true; |
| 1164 } | 1167 } |
| 1165 | 1168 |
| 1166 return false; | 1169 return false; |
| 1167 } | 1170 } |
| 1168 | 1171 |
| 1169 } // namespace content | 1172 } // namespace content |
| OLD | NEW |