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

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

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