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

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: Remove unused function 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 149a4ed46bff2259e2c1d4219d06d9afd876468c..a8bea1f16584294d7c7718cf115a0a38f4555fbc 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()
@@ -343,6 +344,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;
« no previous file with comments | « content/renderer/accessibility/renderer_accessibility_complete.h ('k') | content/test/accessibility_browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698