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

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

Issue 2279413002: Clean up: Accessibility no longer needs site instance or transforms (Closed)
Patch Set: Created 4 years, 3 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/browser/frame_host/render_frame_host_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 705
706 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen( 706 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
707 const gfx::Rect& bounds) const { 707 const gfx::Rect& bounds) const {
708 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 708 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
709 render_view_host_->GetWidget()->GetView()); 709 render_view_host_->GetWidget()->GetView());
710 if (view) 710 if (view)
711 return view->AccessibilityOriginInScreen(bounds); 711 return view->AccessibilityOriginInScreen(bounds);
712 return gfx::Point(); 712 return gfx::Point();
713 } 713 }
714 714
715 gfx::Rect RenderFrameHostImpl::AccessibilityTransformToRootCoordSpace(
716 const gfx::Rect& bounds) {
717 RenderWidgetHostViewBase* view =
718 static_cast<RenderWidgetHostViewBase*>(GetView());
719 gfx::Point p1 = view->TransformPointToRootCoordSpace(bounds.origin());
720 gfx::Point p2 = view->TransformPointToRootCoordSpace(bounds.top_right());
721 gfx::Point p3 = view->TransformPointToRootCoordSpace(bounds.bottom_right());
722 gfx::Point p4 = view->TransformPointToRootCoordSpace(bounds.bottom_left());
723 gfx::QuadF transformed_quad = gfx::QuadF(
724 gfx::PointF(p1), gfx::PointF(p2), gfx::PointF(p3), gfx::PointF(p4));
725 gfx::RectF new_bounds = transformed_quad.BoundingBox();
726 return gfx::Rect(new_bounds.x(), new_bounds.y(),
727 new_bounds.width(), new_bounds.height());
728 }
729
730 SiteInstance* RenderFrameHostImpl::AccessibilityGetSiteInstance() {
731 return GetSiteInstance();
732 }
733
734 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) { 715 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
735 Send(new AccessibilityMsg_HitTest(routing_id_, point)); 716 Send(new AccessibilityMsg_HitTest(routing_id_, point));
736 } 717 }
737 718
738 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) { 719 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) {
739 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id)); 720 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id));
740 } 721 }
741 722
742 void RenderFrameHostImpl::AccessibilityReset() { 723 void RenderFrameHostImpl::AccessibilityReset() {
743 accessibility_reset_token_ = g_next_accessibility_reset_token++; 724 accessibility_reset_token_ = g_next_accessibility_reset_token++;
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3055 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3075 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3056 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3076 return web_bluetooth_service_.get(); 3057 return web_bluetooth_service_.get();
3077 } 3058 }
3078 3059
3079 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3060 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3080 web_bluetooth_service_.reset(); 3061 web_bluetooth_service_.reset();
3081 } 3062 }
3082 3063
3083 } // namespace content 3064 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698