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

Unified 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 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 side-by-side diff with in-line comments
Download patch
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 859a9108f3450ad71e9b4e32fc774f7142efc70b..8367a58f75f65cf5331235d0029fc77ffbdad8e3 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)
@@ -227,6 +229,23 @@ void CrossProcessFrameConnector::OnFrameRectChanged(
SetSize(frame_rect);
}
+void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) {
+ if (!view_)
+ return;
Charlie Reis 2015/12/08 19:18:33 nit: Add blank line after this, before the next bl
EhsanK 2015/12/09 00:14:16 Done.
+ if (frame_proxy_in_parent_renderer_->frame_tree_node()
+ ->render_manager()
+ ->ForInnerDelegate()) {
+ RenderWidgetHostImpl::From(view_->GetRenderWidgetHost())
+ ->delegate()
+ ->ForwardVisibilityChangeToInnerContents(visible);
+ return;
+ }
Charlie Reis 2015/12/08 19:18:33 nit: Same here.
EhsanK 2015/12/09 00:14:16 Done.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698