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

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: Fix gn build 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
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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 628
628 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen( 629 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
629 const gfx::Rect& bounds) const { 630 const gfx::Rect& bounds) const {
630 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 631 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
631 render_view_host_->GetWidget()->GetView()); 632 render_view_host_->GetWidget()->GetView());
632 if (view) 633 if (view)
633 return view->AccessibilityOriginInScreen(bounds); 634 return view->AccessibilityOriginInScreen(bounds);
634 return gfx::Point(); 635 return gfx::Point();
635 } 636 }
636 637
638 gfx::Rect RenderFrameHostImpl::AccessibilityTransformToRootCoordSpace(
639 const gfx::Rect& bounds) {
640 RenderWidgetHostViewBase* view =
641 static_cast<RenderWidgetHostViewBase*>(GetView());
642 gfx::Point p1 = view->TransformPointToRootCoordSpace(bounds.origin());
643 gfx::Point p2 = view->TransformPointToRootCoordSpace(bounds.top_right());
644 gfx::Point p3 = view->TransformPointToRootCoordSpace(bounds.bottom_right());
645 gfx::Point p4 = view->TransformPointToRootCoordSpace(bounds.bottom_left());
646 gfx::QuadF transformed_quad = gfx::QuadF(
647 gfx::PointF(p1), gfx::PointF(p2), gfx::PointF(p3), gfx::PointF(p4));
648 gfx::RectF new_bounds = transformed_quad.BoundingBox();
649 return gfx::Rect(new_bounds.x(), new_bounds.y(),
650 new_bounds.width(), new_bounds.height());
651 }
652
653 SiteInstance* RenderFrameHostImpl::AccessibilityGetSiteInstance() {
654 return GetSiteInstance();
655 }
656
637 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) { 657 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
638 Send(new AccessibilityMsg_HitTest(routing_id_, point)); 658 Send(new AccessibilityMsg_HitTest(routing_id_, point));
639 } 659 }
640 660
641 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) { 661 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) {
642 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id)); 662 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id));
643 } 663 }
644 664
645 void RenderFrameHostImpl::AccessibilityReset() { 665 void RenderFrameHostImpl::AccessibilityReset() {
646 accessibility_reset_token_ = g_next_accessibility_reset_token++; 666 accessibility_reset_token_ = g_next_accessibility_reset_token++;
(...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); 2715 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame();
2696 if (!focused_frame_tree_node) 2716 if (!focused_frame_tree_node)
2697 return; 2717 return;
2698 RenderFrameHostImpl* focused_frame = 2718 RenderFrameHostImpl* focused_frame =
2699 focused_frame_tree_node->current_frame_host(); 2719 focused_frame_tree_node->current_frame_host();
2700 DCHECK(focused_frame); 2720 DCHECK(focused_frame);
2701 dst->focused_tree_id = focused_frame->GetAXTreeID(); 2721 dst->focused_tree_id = focused_frame->GetAXTreeID();
2702 } 2722 }
2703 2723
2704 } // namespace content 2724 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_widget_host_view_child_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698