OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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(), | |
dcheng
2016/03/08 00:39:41
Unless there's something that requires us to do th
dmazzoni
2016/03/16 21:38:13
Sorry, I don't follow what you want me to do. I ne
dcheng
2016/03/16 21:48:31
Just have the function return a gfx::Rect rather t
dmazzoni
2016/03/16 21:53:34
Done.
| |
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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2631 *dst = src; | 2647 *dst = src; |
2632 | 2648 |
2633 if (src.routing_id != -1) | 2649 if (src.routing_id != -1) |
2634 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2650 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
2635 | 2651 |
2636 if (src.parent_routing_id != -1) | 2652 if (src.parent_routing_id != -1) |
2637 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2653 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
2638 } | 2654 } |
2639 | 2655 |
2640 } // namespace content | 2656 } // namespace content |
OLD | NEW |