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

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: Created 5 years, 1 month 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"
(...skipping 25 matching lines...) Expand all
36 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { 36 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) {
37 bool handled = true; 37 bool handled = true;
38 38
39 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg) 39 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg)
40 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK, 40 IPC_MESSAGE_HANDLER(FrameHostMsg_CompositorFrameSwappedACK,
41 OnCompositorFrameSwappedACK) 41 OnCompositorFrameSwappedACK)
42 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources, 42 IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources,
43 OnReclaimCompositorResources) 43 OnReclaimCompositorResources)
44 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) 44 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent)
45 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) 45 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged)
46 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged)
46 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, 47 IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame,
47 OnInitializeChildFrame) 48 OnInitializeChildFrame)
48 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) 49 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence)
49 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence) 50 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence)
50 IPC_MESSAGE_UNHANDLED(handled = false) 51 IPC_MESSAGE_UNHANDLED(handled = false)
51 IPC_END_MESSAGE_MAP() 52 IPC_END_MESSAGE_MAP()
52 53
53 return handled; 54 return handled;
54 } 55 }
55 56
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return; 210 return;
210 } 211 }
211 } 212 }
212 213
213 void CrossProcessFrameConnector::OnFrameRectChanged( 214 void CrossProcessFrameConnector::OnFrameRectChanged(
214 const gfx::Rect& frame_rect) { 215 const gfx::Rect& frame_rect) {
215 if (!frame_rect.size().IsEmpty()) 216 if (!frame_rect.size().IsEmpty())
216 SetSize(frame_rect); 217 SetSize(frame_rect);
217 } 218 }
218 219
220 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) {
221 if (!view_)
222 return;
223 view_->SetVisibility(visible);
kenrb 2015/11/04 21:57:42 Why not just call Show() or Hide() directly, rathe
EhsanK 2015/11/05 15:57:39 This is a provision for <webview>. My understandin
kenrb 2015/11/11 16:09:33 This sounds a bit hacky, but I don't know the <web
EhsanK 2015/11/11 19:13:18 Done. I will also add Istiaque to take a look at t
224 }
225
219 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { 226 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) {
220 device_scale_factor_ = scale_factor; 227 device_scale_factor_ = scale_factor;
221 // The RenderWidgetHost is null in unit tests. 228 // The RenderWidgetHost is null in unit tests.
222 if (view_ && view_->GetRenderWidgetHost()) { 229 if (view_ && view_->GetRenderWidgetHost()) {
223 RenderWidgetHostImpl* child_widget = 230 RenderWidgetHostImpl* child_widget =
224 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()); 231 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost());
225 child_widget->NotifyScreenInfoChanged(); 232 child_widget->NotifyScreenInfoChanged();
226 } 233 }
227 } 234 }
228 235
(...skipping 12 matching lines...) Expand all
241 // in the case of nested WebContents. 248 // in the case of nested WebContents.
242 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) { 249 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) {
243 top_host = top_host->frame_tree_node()->render_manager()-> 250 top_host = top_host->frame_tree_node()->render_manager()->
244 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host(); 251 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host();
245 } 252 }
246 253
247 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView()); 254 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView());
248 } 255 }
249 256
250 } // namespace content 257 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698