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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility.cc

Issue 1836113002: Fix accessible touch exploration inside of iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test startup on Android Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/accessibility_browser_test_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/accessibility/renderer_accessibility.h" 5 #include "content/renderer/accessibility/renderer_accessibility.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 void RendererAccessibility::OnHitTest(gfx::Point point) { 378 void RendererAccessibility::OnHitTest(gfx::Point point) {
379 const WebDocument& document = GetMainDocument(); 379 const WebDocument& document = GetMainDocument();
380 if (document.isNull()) 380 if (document.isNull())
381 return; 381 return;
382 WebAXObject root_obj = document.accessibilityObject(); 382 WebAXObject root_obj = document.accessibilityObject();
383 if (!root_obj.updateLayoutAndCheckValidity()) 383 if (!root_obj.updateLayoutAndCheckValidity())
384 return; 384 return;
385 385
386 WebAXObject obj = root_obj.hitTest(point); 386 WebAXObject obj = root_obj.hitTest(point);
387 if (!obj.isDetached()) 387 if (obj.isDetached())
388 HandleAXEvent(obj, ui::AX_EVENT_HOVER); 388 return;
389
390 // If the object that was hit has a child frame, we have to send a
391 // message back to the browser to do the hit test in the child frame,
392 // recursively.
393 AXContentNodeData data;
394 tree_source_.SerializeNode(obj, &data);
395 if (data.HasContentIntAttribute(AX_CONTENT_ATTR_CHILD_ROUTING_ID) ||
396 data.HasContentIntAttribute(
397 AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID)) {
398 Send(new AccessibilityHostMsg_ChildFrameHitTestResult(routing_id(), point,
399 obj.axID()));
400 return;
401 }
402
403 // Otherwise, send a HOVER event on the node that was hit.
404 HandleAXEvent(obj, ui::AX_EVENT_HOVER);
389 } 405 }
390 406
391 void RendererAccessibility::OnSetAccessibilityFocus(int acc_obj_id) { 407 void RendererAccessibility::OnSetAccessibilityFocus(int acc_obj_id) {
392 if (tree_source_.accessibility_focus_id() == acc_obj_id) 408 if (tree_source_.accessibility_focus_id() == acc_obj_id)
393 return; 409 return;
394 410
395 tree_source_.set_accessibility_focus_id(acc_obj_id); 411 tree_source_.set_accessibility_focus_id(acc_obj_id);
396 412
397 const WebDocument& document = GetMainDocument(); 413 const WebDocument& document = GetMainDocument();
398 if (document.isNull()) 414 if (document.isNull())
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 #ifndef NDEBUG 595 #ifndef NDEBUG
580 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id; 596 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id;
581 #endif 597 #endif
582 return; 598 return;
583 } 599 }
584 600
585 obj.showContextMenu(); 601 obj.showContextMenu();
586 } 602 }
587 603
588 } // namespace content 604 } // namespace content
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/test/accessibility_browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698