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

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

Issue 2748463003: Generalize the HIT_TEST accessibility action so that it can send any event. (Closed)
Patch Set: Use ParseAXEvent Created 3 years, 9 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/render_accessibility_impl.cc
diff --git a/content/renderer/accessibility/render_accessibility_impl.cc b/content/renderer/accessibility/render_accessibility_impl.cc
index e6567ee5f6ae246ab63258df25cee8906d19c823..19a813a0620b923e12b6a91fc898548735bcd4c3 100644
--- a/content/renderer/accessibility/render_accessibility_impl.cc
+++ b/content/renderer/accessibility/render_accessibility_impl.cc
@@ -471,7 +471,8 @@ void RenderAccessibilityImpl::OnPerformAction(
OnGetImageData(target, data.target_rect.size());
break;
case ui::AX_ACTION_HIT_TEST:
- OnHitTest(data.target_point);
+ DCHECK(data.hit_test_event_to_fire != ui::AX_EVENT_NONE);
+ OnHitTest(data.target_point, data.hit_test_event_to_fire);
break;
case ui::AX_ACTION_INCREMENT:
target.increment();
@@ -535,7 +536,8 @@ void RenderAccessibilityImpl::OnFatalError() {
CHECK(false) << "Invalid accessibility tree.";
}
-void RenderAccessibilityImpl::OnHitTest(const gfx::Point& point) {
+void RenderAccessibilityImpl::OnHitTest(const gfx::Point& point,
+ ui::AXEvent event_to_fire) {
const WebDocument& document = GetMainDocument();
if (document.isNull())
return;
@@ -556,13 +558,13 @@ void RenderAccessibilityImpl::OnHitTest(const gfx::Point& point) {
if (data.HasContentIntAttribute(AX_CONTENT_ATTR_CHILD_ROUTING_ID) ||
data.HasContentIntAttribute(
AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID)) {
- Send(new AccessibilityHostMsg_ChildFrameHitTestResult(routing_id(), point,
- obj.axID()));
+ Send(new AccessibilityHostMsg_ChildFrameHitTestResult(
+ routing_id(), point, obj.axID(), event_to_fire));
return;
}
- // Otherwise, send a HOVER event on the node that was hit.
- HandleAXEvent(obj, ui::AX_EVENT_HOVER);
+ // Otherwise, send an event on the node that was hit.
+ HandleAXEvent(obj, event_to_fire);
}
void RenderAccessibilityImpl::OnSetAccessibilityFocus(
« no previous file with comments | « content/renderer/accessibility/render_accessibility_impl.h ('k') | third_party/closure_compiler/externs/automation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698