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

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

Issue 1414663011: Notifying the Out of Process Renderer about Visibility Change of a Remote Frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the Call to WebRemoteFrameImpl::close() and WebViewHelper::reset() in the Destructor of the … Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/cross_process_frame_connector.h" 5 #include "content/browser/frame_host/cross_process_frame_connector.h"
6 6
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
11 #include "content/browser/frame_host/frame_tree_node.h" 11 #include "content/browser/frame_host/frame_tree_node.h"
12 #include "content/browser/frame_host/render_frame_host_manager.h" 12 #include "content/browser/frame_host/render_frame_host_manager.h"
13 #include "content/browser/frame_host/render_frame_proxy_host.h" 13 #include "content/browser/frame_host/render_frame_proxy_host.h"
14 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 14 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
15 #include "content/browser/renderer_host/render_view_host_impl.h" 15 #include "content/browser/renderer_host/render_view_host_impl.h"
16 #include "content/browser/renderer_host/render_widget_host_delegate.h"
16 #include "content/browser/renderer_host/render_widget_host_impl.h" 17 #include "content/browser/renderer_host/render_widget_host_impl.h"
17 #include "content/browser/renderer_host/render_widget_host_view_base.h" 18 #include "content/browser/renderer_host/render_widget_host_view_base.h"
18 #include "content/common/frame_messages.h" 19 #include "content/common/frame_messages.h"
19 #include "content/common/gpu/gpu_messages.h" 20 #include "content/common/gpu/gpu_messages.h"
20 #include "third_party/WebKit/public/web/WebInputEvent.h" 21 #include "third_party/WebKit/public/web/WebInputEvent.h"
21 22
22 namespace content { 23 namespace content {
23 24
24 CrossProcessFrameConnector::CrossProcessFrameConnector( 25 CrossProcessFrameConnector::CrossProcessFrameConnector(
25 RenderFrameProxyHost* frame_proxy_in_parent_renderer) 26 RenderFrameProxyHost* frame_proxy_in_parent_renderer)
(...skipping 10 matching lines...) Expand all
36 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { 37 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) {
37 bool handled = true; 38 bool handled = true;
38 39
39 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg) 40 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg)
40 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK, 41 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK,
41 OnCompositorFrameSwappedACK) 42 OnCompositorFrameSwappedACK)
42 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources, 43 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources,
43 OnReclaimCompositorResources) 44 OnReclaimCompositorResources)
44 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) 45 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent)
45 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) 46 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged)
47 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged)
46 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, 48 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame,
47 OnInitializeChildFrame) 49 OnInitializeChildFrame)
48 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) 50 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence)
49 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence) 51 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence)
50 IPC_MESSAGE_UNHANDLED(handled = false) 52 IPC_MESSAGE_UNHANDLED(handled = false)
51 IPC_END_MESSAGE_MAP() 53 IPC_END_MESSAGE_MAP()
52 54
53 return handled; 55 return handled;
54 } 56 }
55 57
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return; 222 return;
221 } 223 }
222 } 224 }
223 225
224 void CrossProcessFrameConnector::OnFrameRectChanged( 226 void CrossProcessFrameConnector::OnFrameRectChanged(
225 const gfx::Rect& frame_rect) { 227 const gfx::Rect& frame_rect) {
226 if (!frame_rect.size().IsEmpty()) 228 if (!frame_rect.size().IsEmpty())
227 SetSize(frame_rect); 229 SetSize(frame_rect);
228 } 230 }
229 231
232 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) {
233 if (!view_)
234 return;
235
236 if (visible)
237 view_->Show();
238 else
239 view_->Hide();
240 }
241
230 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { 242 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) {
231 device_scale_factor_ = scale_factor; 243 device_scale_factor_ = scale_factor;
232 // The RenderWidgetHost is null in unit tests. 244 // The RenderWidgetHost is null in unit tests.
233 if (view_ && view_->GetRenderWidgetHost()) { 245 if (view_ && view_->GetRenderWidgetHost()) {
234 RenderWidgetHostImpl* child_widget = 246 RenderWidgetHostImpl* child_widget =
235 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()); 247 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost());
236 child_widget->NotifyScreenInfoChanged(); 248 child_widget->NotifyScreenInfoChanged();
237 } 249 }
238 } 250 }
239 251
(...skipping 12 matching lines...) Expand all
252 // in the case of nested WebContents. 264 // in the case of nested WebContents.
253 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) { 265 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) {
254 top_host = top_host->frame_tree_node()->render_manager()-> 266 top_host = top_host->frame_tree_node()->render_manager()->
255 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host(); 267 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host();
256 } 268 }
257 269
258 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView()); 270 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView());
259 } 271 }
260 272
261 } // namespace content 273 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/cross_process_frame_connector.h ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698