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

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: Fixed another skia dependency Created 4 years, 10 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/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "content/public/browser/render_widget_host_view.h" 69 #include "content/public/browser/render_widget_host_view.h"
70 #include "content/public/browser/stream_handle.h" 70 #include "content/public/browser/stream_handle.h"
71 #include "content/public/browser/user_metrics.h" 71 #include "content/public/browser/user_metrics.h"
72 #include "content/public/common/browser_side_navigation_policy.h" 72 #include "content/public/common/browser_side_navigation_policy.h"
73 #include "content/public/common/content_constants.h" 73 #include "content/public/common/content_constants.h"
74 #include "content/public/common/isolated_world_ids.h" 74 #include "content/public/common/isolated_world_ids.h"
75 #include "content/public/common/url_constants.h" 75 #include "content/public/common/url_constants.h"
76 #include "content/public/common/url_utils.h" 76 #include "content/public/common/url_utils.h"
77 #include "ui/accessibility/ax_tree.h" 77 #include "ui/accessibility/ax_tree.h"
78 #include "ui/accessibility/ax_tree_update.h" 78 #include "ui/accessibility/ax_tree_update.h"
79 #include "ui/gfx/geometry/quad_f.h"
79 #include "url/gurl.h" 80 #include "url/gurl.h"
80 81
81 #if defined(OS_ANDROID) 82 #if defined(OS_ANDROID)
82 #include "content/browser/mojo/service_registrar_android.h" 83 #include "content/browser/mojo/service_registrar_android.h"
83 #endif 84 #endif
84 85
85 #if defined(OS_MACOSX) 86 #if defined(OS_MACOSX)
86 #include "content/browser/frame_host/popup_menu_helper_mac.h" 87 #include "content/browser/frame_host/popup_menu_helper_mac.h"
87 #endif 88 #endif
88 89
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 644
644 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen( 645 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
645 const gfx::Rect& bounds) const { 646 const gfx::Rect& bounds) const {
646 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 647 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
647 render_view_host_->GetWidget()->GetView()); 648 render_view_host_->GetWidget()->GetView());
648 if (view) 649 if (view)
649 return view->AccessibilityOriginInScreen(bounds); 650 return view->AccessibilityOriginInScreen(bounds);
650 return gfx::Point(); 651 return gfx::Point();
651 } 652 }
652 653
654 void RenderFrameHostImpl::AccessibilityTransformToRootCoordSpace(
655 gfx::Rect* bounds) {
656 RenderWidgetHostViewBase* view =
657 static_cast<RenderWidgetHostViewBase*>(GetView());
658 gfx::Point p1 = view->TransformPointToRootCoordSpace(bounds->origin());
659 gfx::Point p2 = view->TransformPointToRootCoordSpace(bounds->top_right());
660 gfx::Point p3 = view->TransformPointToRootCoordSpace(bounds->bottom_right());
661 gfx::Point p4 = view->TransformPointToRootCoordSpace(bounds->bottom_left());
662 gfx::QuadF transformed_quad = gfx::QuadF(
663 gfx::PointF(p1), gfx::PointF(p2), gfx::PointF(p3), gfx::PointF(p4));
664 gfx::RectF new_bounds = transformed_quad.BoundingBox();
665 *bounds = gfx::Rect(new_bounds.x(), new_bounds.y(),
666 new_bounds.width(), new_bounds.height());
667 }
668
653 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) { 669 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
654 Send(new AccessibilityMsg_HitTest(routing_id_, point)); 670 Send(new AccessibilityMsg_HitTest(routing_id_, point));
655 } 671 }
656 672
657 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) { 673 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) {
658 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id)); 674 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id));
659 } 675 }
660 676
661 void RenderFrameHostImpl::AccessibilityReset() { 677 void RenderFrameHostImpl::AccessibilityReset() {
662 accessibility_reset_token_ = g_next_accessibility_reset_token++; 678 accessibility_reset_token_ = g_next_accessibility_reset_token++;
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 *dst = src; 2615 *dst = src;
2600 2616
2601 if (src.routing_id != -1) 2617 if (src.routing_id != -1)
2602 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); 2618 dst->tree_id = RoutingIDToAXTreeID(src.routing_id);
2603 2619
2604 if (src.parent_routing_id != -1) 2620 if (src.parent_routing_id != -1)
2605 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); 2621 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id);
2606 } 2622 }
2607 2623
2608 } // namespace content 2624 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698