Chromium Code Reviews| Index: content/browser/frame_host/cross_process_frame_connector.cc |
| diff --git a/content/browser/frame_host/cross_process_frame_connector.cc b/content/browser/frame_host/cross_process_frame_connector.cc |
| index aae77095658467e30fe8227f56b4eff7cbea9a06..0ecf6242c58ba5d985160b202ba7c356050aac1d 100644 |
| --- a/content/browser/frame_host/cross_process_frame_connector.cc |
| +++ b/content/browser/frame_host/cross_process_frame_connector.cc |
| @@ -13,6 +13,7 @@ |
| #include "content/browser/frame_host/render_frame_proxy_host.h" |
| #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| #include "content/browser/renderer_host/render_view_host_impl.h" |
| +#include "content/browser/renderer_host/render_widget_host_delegate.h" |
| #include "content/browser/renderer_host/render_widget_host_impl.h" |
| #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| #include "content/common/frame_messages.h" |
| @@ -43,6 +44,7 @@ bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { |
| OnReclaimCompositorResources) |
| IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) |
| IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) |
| + IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged) |
| IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, |
| OnInitializeChildFrame) |
| IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) |
| @@ -216,6 +218,23 @@ void CrossProcessFrameConnector::OnFrameRectChanged( |
| SetSize(frame_rect); |
| } |
| +void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) { |
| + if (!view_) |
| + return; |
| + if (frame_proxy_in_parent_renderer_->frame_tree_node() |
| + ->render_manager() |
| + ->ForInnerDelegate()) { |
| + static_cast<RenderWidgetHostImpl*>(view_->GetRenderWidgetHost()) |
|
Fady Samuel
2015/11/23 16:29:45
nit: I think RenderWidgetHostImpl::From(...) is pr
EhsanK
2015/12/07 16:10:15
Done.
|
| + ->delegate() |
| + ->ForwardVisibilityChangeToInnerContents(visible); |
| + return; |
| + } |
| + if (visible) |
| + view_->Show(); |
| + else |
| + view_->Hide(); |
| +} |
| + |
| void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { |
| device_scale_factor_ = scale_factor; |
| // The RenderWidgetHost is null in unit tests. |