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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1713723002: Implement accessibility support for CSS-transformed iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return gfx::Rect from AccessibilityTransformToRootCoordSpace, get rid of ifdefed-out code accidenta… Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "content/public/browser/stream_handle.h" 71 #include "content/public/browser/stream_handle.h"
72 #include "content/public/browser/user_metrics.h" 72 #include "content/public/browser/user_metrics.h"
73 #include "content/public/common/browser_side_navigation_policy.h" 73 #include "content/public/common/browser_side_navigation_policy.h"
74 #include "content/public/common/content_constants.h" 74 #include "content/public/common/content_constants.h"
75 #include "content/public/common/content_switches.h" 75 #include "content/public/common/content_switches.h"
76 #include "content/public/common/isolated_world_ids.h" 76 #include "content/public/common/isolated_world_ids.h"
77 #include "content/public/common/url_constants.h" 77 #include "content/public/common/url_constants.h"
78 #include "content/public/common/url_utils.h" 78 #include "content/public/common/url_utils.h"
79 #include "ui/accessibility/ax_tree.h" 79 #include "ui/accessibility/ax_tree.h"
80 #include "ui/accessibility/ax_tree_update.h" 80 #include "ui/accessibility/ax_tree_update.h"
81 #include "ui/gfx/geometry/quad_f.h"
81 #include "url/gurl.h" 82 #include "url/gurl.h"
82 83
83 #if defined(OS_ANDROID) 84 #if defined(OS_ANDROID)
84 #include "content/browser/mojo/service_registrar_android.h" 85 #include "content/browser/mojo/service_registrar_android.h"
85 #endif 86 #endif
86 87
87 #if defined(OS_MACOSX) 88 #if defined(OS_MACOSX)
88 #include "content/browser/frame_host/popup_menu_helper_mac.h" 89 #include "content/browser/frame_host/popup_menu_helper_mac.h"
89 #endif 90 #endif
90 91
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 640
640 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen( 641 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
641 const gfx::Rect& bounds) const { 642 const gfx::Rect& bounds) const {
642 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 643 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
643 render_view_host_->GetWidget()->GetView()); 644 render_view_host_->GetWidget()->GetView());
644 if (view) 645 if (view)
645 return view->AccessibilityOriginInScreen(bounds); 646 return view->AccessibilityOriginInScreen(bounds);
646 return gfx::Point(); 647 return gfx::Point();
647 } 648 }
648 649
650 gfx::Rect RenderFrameHostImpl::AccessibilityTransformToRootCoordSpace(
651 const gfx::Rect& bounds) {
652 RenderWidgetHostViewBase* view =
653 static_cast<RenderWidgetHostViewBase*>(GetView());
654 gfx::Point p1 = view->TransformPointToRootCoordSpace(bounds.origin());
655 gfx::Point p2 = view->TransformPointToRootCoordSpace(bounds.top_right());
656 gfx::Point p3 = view->TransformPointToRootCoordSpace(bounds.bottom_right());
657 gfx::Point p4 = view->TransformPointToRootCoordSpace(bounds.bottom_left());
658 gfx::QuadF transformed_quad = gfx::QuadF(
659 gfx::PointF(p1), gfx::PointF(p2), gfx::PointF(p3), gfx::PointF(p4));
660 gfx::RectF new_bounds = transformed_quad.BoundingBox();
661 return gfx::Rect(new_bounds.x(), new_bounds.y(),
662 new_bounds.width(), new_bounds.height());
663 }
664
665 SiteInstance* RenderFrameHostImpl::AccessibilityGetSiteInstance() {
666 return GetSiteInstance();
667 }
668
649 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) { 669 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
650 Send(new AccessibilityMsg_HitTest(routing_id_, point)); 670 Send(new AccessibilityMsg_HitTest(routing_id_, point));
651 } 671 }
652 672
653 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) { 673 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) {
654 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id)); 674 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id));
655 } 675 }
656 676
657 void RenderFrameHostImpl::AccessibilityReset() { 677 void RenderFrameHostImpl::AccessibilityReset() {
658 accessibility_reset_token_ = g_next_accessibility_reset_token++; 678 accessibility_reset_token_ = g_next_accessibility_reset_token++;
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); 2726 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame();
2707 if (!focused_frame_tree_node) 2727 if (!focused_frame_tree_node)
2708 return; 2728 return;
2709 RenderFrameHostImpl* focused_frame = 2729 RenderFrameHostImpl* focused_frame =
2710 focused_frame_tree_node->current_frame_host(); 2730 focused_frame_tree_node->current_frame_host();
2711 DCHECK(focused_frame); 2731 DCHECK(focused_frame);
2712 dst->focused_tree_id = focused_frame->GetAXTreeID(); 2732 dst->focused_tree_id = focused_frame->GetAXTreeID();
2713 } 2733 }
2714 2734
2715 } // namespace content 2735 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698