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

Unified Diff: content/renderer/accessibility/renderer_accessibility_complete.cc

Issue 290633002: Implement Android accessible hit testing using an IPC to the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@better_logging_2
Patch Set: Tweak to algorithm to find highest leaf ancestor Created 6 years, 7 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: content/renderer/accessibility/renderer_accessibility_complete.cc
diff --git a/content/renderer/accessibility/renderer_accessibility_complete.cc b/content/renderer/accessibility/renderer_accessibility_complete.cc
index 7d555ccbb245e68d8ec80fb39dcbd251a8253638..031d17e6c4a2b30ebdcc422c30c9146eb4bf0b9b 100644
--- a/content/renderer/accessibility/renderer_accessibility_complete.cc
+++ b/content/renderer/accessibility/renderer_accessibility_complete.cc
@@ -73,6 +73,7 @@ bool RendererAccessibilityComplete::OnMessageReceived(
OnScrollToPoint)
IPC_MESSAGE_HANDLER(AccessibilityMsg_SetTextSelection,
OnSetTextSelection)
+ IPC_MESSAGE_HANDLER(AccessibilityMsg_HitTest, OnHitTest)
IPC_MESSAGE_HANDLER(AccessibilityMsg_FatalError, OnFatalError)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -337,6 +338,19 @@ void RendererAccessibilityComplete::OnSetTextSelection(
}
}
+void RendererAccessibilityComplete::OnHitTest(gfx::Point point) {
+ const WebDocument& document = GetMainDocument();
+ if (document.isNull())
+ return;
+ WebAXObject root_obj = document.accessibilityObject();
+ if (!root_obj.updateBackingStoreAndCheckValidity())
+ return;
+
+ WebAXObject obj = root_obj.hitTest(point);
+ if (!obj.isDetached())
+ HandleAXEvent(obj, ui::AX_EVENT_HOVER);
+}
+
void RendererAccessibilityComplete::OnEventsAck() {
DCHECK(ack_pending_);
ack_pending_ = false;

Powered by Google App Engine
This is Rietveld 408576698