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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2951053005: Add Mojo API for Blink hit testing (Closed)
Patch Set: Address Rob's comments Created 3 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 ::ClipCursor(&window_rect); 891 ::ClipCursor(&window_rect);
892 } 892 }
893 893
894 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() { 894 void RenderWidgetHostViewAura::OnLegacyWindowDestroyed() {
895 legacy_render_widget_host_HWND_ = nullptr; 895 legacy_render_widget_host_HWND_ = nullptr;
896 legacy_window_destroyed_ = true; 896 legacy_window_destroyed_ = true;
897 } 897 }
898 #endif 898 #endif
899 899
900 void RenderWidgetHostViewAura::DidCreateNewRendererCompositorFrameSink( 900 void RenderWidgetHostViewAura::DidCreateNewRendererCompositorFrameSink(
901 viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) { 901 viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink,
902 viz::mojom::TargetFrameForInputDelegate* input_delegate) {
902 renderer_compositor_frame_sink_ = renderer_compositor_frame_sink; 903 renderer_compositor_frame_sink_ = renderer_compositor_frame_sink;
904 target_frame_for_input_delegate_ = input_delegate;
903 if (delegated_frame_host_) { 905 if (delegated_frame_host_) {
904 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink( 906 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
905 renderer_compositor_frame_sink_); 907 renderer_compositor_frame_sink_, input_delegate);
906 } 908 }
907 } 909 }
908 910
909 void RenderWidgetHostViewAura::SubmitCompositorFrame( 911 void RenderWidgetHostViewAura::SubmitCompositorFrame(
910 const viz::LocalSurfaceId& local_surface_id, 912 const viz::LocalSurfaceId& local_surface_id,
911 cc::CompositorFrame frame) { 913 cc::CompositorFrame frame) {
912 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame"); 914 TRACE_EVENT0("content", "RenderWidgetHostViewAura::OnSwapCompositorFrame");
913 915
914 // Override the background color to the current compositor background. 916 // Override the background color to the current compositor background.
915 // This allows us to, when navigating to a new page, transfer this color to 917 // This allows us to, when navigating to a new page, transfer this color to
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 if (IsMus()) 1946 if (IsMus())
1945 return; 1947 return;
1946 1948
1947 // Tests may set |delegated_frame_host_client_|. 1949 // Tests may set |delegated_frame_host_client_|.
1948 if (!delegated_frame_host_client_) { 1950 if (!delegated_frame_host_client_) {
1949 delegated_frame_host_client_ = 1951 delegated_frame_host_client_ =
1950 base::MakeUnique<DelegatedFrameHostClientAura>(this); 1952 base::MakeUnique<DelegatedFrameHostClientAura>(this);
1951 } 1953 }
1952 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>( 1954 delegated_frame_host_ = base::MakeUnique<DelegatedFrameHost>(
1953 frame_sink_id_, delegated_frame_host_client_.get()); 1955 frame_sink_id_, delegated_frame_host_client_.get());
1954 if (renderer_compositor_frame_sink_) { 1956 if (renderer_compositor_frame_sink_ && target_frame_for_input_delegate_) {
1955 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink( 1957 delegated_frame_host_->DidCreateNewRendererCompositorFrameSink(
1956 renderer_compositor_frame_sink_); 1958 renderer_compositor_frame_sink_, target_frame_for_input_delegate_);
1957 } 1959 }
1958 UpdateNeedsBeginFramesInternal(); 1960 UpdateNeedsBeginFramesInternal();
1959 1961
1960 // Let the page-level input event router know about our surface ID 1962 // Let the page-level input event router know about our surface ID
1961 // namespace for surface-based hit testing. 1963 // namespace for surface-based hit testing.
1962 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) { 1964 if (host_->delegate() && host_->delegate()->GetInputEventRouter()) {
1963 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner( 1965 host_->delegate()->GetInputEventRouter()->AddFrameSinkIdOwner(
1964 GetFrameSinkId(), this); 1966 GetFrameSinkId(), this);
1965 } 1967 }
1966 } 1968 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2430 2432
2431 void RenderWidgetHostViewAura::ScrollFocusedEditableNodeIntoRect( 2433 void RenderWidgetHostViewAura::ScrollFocusedEditableNodeIntoRect(
2432 const gfx::Rect& node_rect) { 2434 const gfx::Rect& node_rect) {
2433 RenderFrameHostImpl* rfh = GetFocusedFrame(); 2435 RenderFrameHostImpl* rfh = GetFocusedFrame();
2434 if (rfh) { 2436 if (rfh) {
2435 rfh->GetFrameInputHandler()->ScrollFocusedEditableNodeIntoRect(node_rect); 2437 rfh->GetFrameInputHandler()->ScrollFocusedEditableNodeIntoRect(node_rect);
2436 } 2438 }
2437 } 2439 }
2438 2440
2439 } // namespace content 2441 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698