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

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

Issue 2426193003: Re-land: Create AXAction and AXActionData as a way to simplify accessibility actions (Closed)
Patch Set: Rebase Created 4 years, 2 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 return handled; 717 return handled;
718 } 718 }
719 719
720 void RenderFrameHostImpl::OnAssociatedInterfaceRequest( 720 void RenderFrameHostImpl::OnAssociatedInterfaceRequest(
721 const std::string& interface_name, 721 const std::string& interface_name,
722 mojo::ScopedInterfaceEndpointHandle handle) { 722 mojo::ScopedInterfaceEndpointHandle handle) {
723 delegate_->OnAssociatedInterfaceRequest( 723 delegate_->OnAssociatedInterfaceRequest(
724 this, interface_name, std::move(handle)); 724 this, interface_name, std::move(handle));
725 } 725 }
726 726
727 void RenderFrameHostImpl::AccessibilitySetFocus(int object_id) { 727 void RenderFrameHostImpl::AccessibilityPerformAction(
728 Send(new AccessibilityMsg_SetFocus(routing_id_, object_id)); 728 const ui::AXActionData& action_data) {
729 } 729 Send(new AccessibilityMsg_PerformAction(routing_id_, action_data));
730
731 void RenderFrameHostImpl::AccessibilityDoDefaultAction(int object_id) {
732 Send(new AccessibilityMsg_DoDefaultAction(routing_id_, object_id));
733 }
734
735 void RenderFrameHostImpl::AccessibilityShowContextMenu(int acc_obj_id) {
736 Send(new AccessibilityMsg_ShowContextMenu(routing_id_, acc_obj_id));
737 }
738
739 void RenderFrameHostImpl::AccessibilityScrollToMakeVisible(
740 int acc_obj_id, const gfx::Rect& subfocus) {
741 Send(new AccessibilityMsg_ScrollToMakeVisible(
742 routing_id_, acc_obj_id, subfocus));
743 }
744
745 void RenderFrameHostImpl::AccessibilityScrollToPoint(
746 int acc_obj_id, const gfx::Point& point) {
747 Send(new AccessibilityMsg_ScrollToPoint(
748 routing_id_, acc_obj_id, point));
749 }
750
751 void RenderFrameHostImpl::AccessibilitySetScrollOffset(
752 int acc_obj_id, const gfx::Point& offset) {
753 Send(new AccessibilityMsg_SetScrollOffset(
754 routing_id_, acc_obj_id, offset));
755 }
756
757 void RenderFrameHostImpl::AccessibilitySetSelection(int anchor_object_id,
758 int anchor_offset,
759 int focus_object_id,
760 int focus_offset) {
761 Send(new AccessibilityMsg_SetSelection(routing_id_,
762 anchor_object_id,
763 anchor_offset,
764 focus_object_id,
765 focus_offset));
766 }
767
768 void RenderFrameHostImpl::AccessibilitySetValue(
769 int object_id, const base::string16& value) {
770 Send(new AccessibilityMsg_SetValue(routing_id_, object_id, value));
771 } 730 }
772 731
773 bool RenderFrameHostImpl::AccessibilityViewHasFocus() const { 732 bool RenderFrameHostImpl::AccessibilityViewHasFocus() const {
774 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); 733 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
775 if (view) 734 if (view)
776 return view->HasFocus(); 735 return view->HasFocus();
777 return false; 736 return false;
778 } 737 }
779 738
780 gfx::Rect RenderFrameHostImpl::AccessibilityGetViewBounds() const { 739 gfx::Rect RenderFrameHostImpl::AccessibilityGetViewBounds() const {
781 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView(); 740 RenderWidgetHostView* view = render_view_host_->GetWidget()->GetView();
782 if (view) 741 if (view)
783 return view->GetViewBounds(); 742 return view->GetViewBounds();
784 return gfx::Rect(); 743 return gfx::Rect();
785 } 744 }
786 745
787 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen( 746 gfx::Point RenderFrameHostImpl::AccessibilityOriginInScreen(
788 const gfx::Rect& bounds) const { 747 const gfx::Rect& bounds) const {
789 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 748 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
790 render_view_host_->GetWidget()->GetView()); 749 render_view_host_->GetWidget()->GetView());
791 if (view) 750 if (view)
792 return view->AccessibilityOriginInScreen(bounds); 751 return view->AccessibilityOriginInScreen(bounds);
793 return gfx::Point(); 752 return gfx::Point();
794 } 753 }
795 754
796 void RenderFrameHostImpl::AccessibilityHitTest(const gfx::Point& point) {
797 Send(new AccessibilityMsg_HitTest(routing_id_, point));
798 }
799
800 void RenderFrameHostImpl::AccessibilitySetAccessibilityFocus(int acc_obj_id) {
801 Send(new AccessibilityMsg_SetAccessibilityFocus(routing_id_, acc_obj_id));
802 }
803
804 void RenderFrameHostImpl::AccessibilityReset() { 755 void RenderFrameHostImpl::AccessibilityReset() {
805 accessibility_reset_token_ = g_next_accessibility_reset_token++; 756 accessibility_reset_token_ = g_next_accessibility_reset_token++;
806 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_)); 757 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_));
807 } 758 }
808 759
809 void RenderFrameHostImpl::AccessibilityFatalError() { 760 void RenderFrameHostImpl::AccessibilityFatalError() {
810 browser_accessibility_manager_.reset(NULL); 761 browser_accessibility_manager_.reset(NULL);
811 if (accessibility_reset_token_) 762 if (accessibility_reset_token_)
812 return; 763 return;
813 764
(...skipping 2373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3187 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3138 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3188 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3139 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3189 return web_bluetooth_service_.get(); 3140 return web_bluetooth_service_.get();
3190 } 3141 }
3191 3142
3192 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3143 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3193 web_bluetooth_service_.reset(); 3144 web_bluetooth_service_.reset();
3194 } 3145 }
3195 3146
3196 } // namespace content 3147 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/common/accessibility_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698