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

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

Issue 1892593003: Prevent child frames from sending bad accessibility events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager_win.cc ('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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 Send(new AccessibilityMsg_FatalError(routing_id_)); 672 Send(new AccessibilityMsg_FatalError(routing_id_));
673 } else { 673 } else {
674 accessibility_reset_token_ = g_next_accessibility_reset_token++; 674 accessibility_reset_token_ = g_next_accessibility_reset_token++;
675 UMA_HISTOGRAM_COUNTS("Accessibility.FrameResetCount", 1); 675 UMA_HISTOGRAM_COUNTS("Accessibility.FrameResetCount", 1);
676 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_)); 676 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_));
677 } 677 }
678 } 678 }
679 679
680 gfx::AcceleratedWidget 680 gfx::AcceleratedWidget
681 RenderFrameHostImpl::AccessibilityGetAcceleratedWidget() { 681 RenderFrameHostImpl::AccessibilityGetAcceleratedWidget() {
682 // Only the main frame's current frame host is connected to the native
683 // widget tree for accessibility, so return null if this is queried on
684 // any other frame.
685 if (frame_tree_node()->parent() ||
686 frame_tree_node()->current_frame_host() != this) {
687 return gfx::kNullAcceleratedWidget;
688 }
689
682 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 690 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
683 render_view_host_->GetWidget()->GetView()); 691 render_view_host_->GetWidget()->GetView());
684 if (view) 692 if (view)
685 return view->AccessibilityGetAcceleratedWidget(); 693 return view->AccessibilityGetAcceleratedWidget();
686 return gfx::kNullAcceleratedWidget; 694 return gfx::kNullAcceleratedWidget;
687 } 695 }
688 696
689 gfx::NativeViewAccessible 697 gfx::NativeViewAccessible
690 RenderFrameHostImpl::AccessibilityGetNativeViewAccessible() { 698 RenderFrameHostImpl::AccessibilityGetNativeViewAccessible() {
691 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( 699 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 } 2752 }
2745 2753
2746 void RenderFrameHostImpl::CreateWebBluetoothService( 2754 void RenderFrameHostImpl::CreateWebBluetoothService(
2747 blink::mojom::WebBluetoothServiceRequest request) { 2755 blink::mojom::WebBluetoothServiceRequest request) {
2748 DCHECK(!web_bluetooth_service_); 2756 DCHECK(!web_bluetooth_service_);
2749 web_bluetooth_service_.reset( 2757 web_bluetooth_service_.reset(
2750 new WebBluetoothServiceImpl(this, std::move(request))); 2758 new WebBluetoothServiceImpl(this, std::move(request)));
2751 } 2759 }
2752 2760
2753 } // namespace content 2761 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_manager_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698