Commit c3344361 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Propagate the frame visibility change into web contents.

In change d6703f91 the entire visibility
state is provided, however it would cause hidden->hidden transitions.
To correct this we really should just replicate the state into
web_contents entirely because it has the same states.

BUG=932059

Change-Id: I67895d97e7da5ea5903fe7e9bd7d03fc38a03113
Reviewed-on: https://chromium-review.googlesource.com/c/1478935Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633766}
parent 35d187cf
...@@ -394,7 +394,7 @@ void CrossProcessFrameConnector::OnVisibilityChanged( ...@@ -394,7 +394,7 @@ void CrossProcessFrameConnector::OnVisibilityChanged(
if (frame_proxy_in_parent_renderer_->frame_tree_node() if (frame_proxy_in_parent_renderer_->frame_tree_node()
->render_manager() ->render_manager()
->ForInnerDelegate()) { ->ForInnerDelegate()) {
view_->host()->delegate()->OnRenderFrameProxyVisibilityChanged(visible); view_->host()->delegate()->OnRenderFrameProxyVisibilityChanged(visibility_);
return; return;
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "content/public/common/drop_data.h" #include "content/public/common/drop_data.h"
#include "services/metrics/public/cpp/ukm_recorder.h" #include "services/metrics/public/cpp/ukm_recorder.h"
#include "third_party/blink/public/common/manifest/web_display_mode.h" #include "third_party/blink/public/common/manifest/web_display_mode.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom.h"
#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_drag_operation.h"
#include "third_party/blink/public/platform/web_input_event.h" #include "third_party/blink/public/platform/web_input_event.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
...@@ -237,7 +238,8 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { ...@@ -237,7 +238,8 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
// WebContents changes. This method is only called on an inner WebContents and // WebContents changes. This method is only called on an inner WebContents and
// will eventually notify all the RenderWidgetHostViews belonging to that // will eventually notify all the RenderWidgetHostViews belonging to that
// WebContents. // WebContents.
virtual void OnRenderFrameProxyVisibilityChanged(bool visible) {} virtual void OnRenderFrameProxyVisibilityChanged(
blink::mojom::FrameVisibility visibility) {}
// Update the renderer's cache of the screen rect of the view and window. // Update the renderer's cache of the screen rect of the view and window.
virtual void SendScreenRects() {} virtual void SendScreenRects() {}
......
...@@ -2659,11 +2659,19 @@ RenderWidgetHostImpl* WebContentsImpl::GetKeyboardLockWidget() { ...@@ -2659,11 +2659,19 @@ RenderWidgetHostImpl* WebContentsImpl::GetKeyboardLockWidget() {
return keyboard_lock_widget_; return keyboard_lock_widget_;
} }
void WebContentsImpl::OnRenderFrameProxyVisibilityChanged(bool visible) { void WebContentsImpl::OnRenderFrameProxyVisibilityChanged(
if (visible && !GetOuterWebContents()->IsHidden()) blink::mojom::FrameVisibility visibility) {
switch (visibility) {
case blink::mojom::FrameVisibility::kRenderedInViewport:
WasShown(); WasShown();
else if (!visible) break;
case blink::mojom::FrameVisibility::kNotRendered:
WasHidden(); WasHidden();
break;
case blink::mojom::FrameVisibility::kRenderedOutOfViewport:
WasOccluded();
break;
}
} }
void WebContentsImpl::CreateNewWindow( void WebContentsImpl::CreateNewWindow(
......
...@@ -777,7 +777,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, ...@@ -777,7 +777,8 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void LostMouseLock(RenderWidgetHostImpl* render_widget_host) override; void LostMouseLock(RenderWidgetHostImpl* render_widget_host) override;
bool HasMouseLock(RenderWidgetHostImpl* render_widget_host) override; bool HasMouseLock(RenderWidgetHostImpl* render_widget_host) override;
RenderWidgetHostImpl* GetMouseLockWidget() override; RenderWidgetHostImpl* GetMouseLockWidget() override;
void OnRenderFrameProxyVisibilityChanged(bool visible) override; void OnRenderFrameProxyVisibilityChanged(
blink::mojom::FrameVisibility visibility) override;
void SendScreenRects() override; void SendScreenRects() override;
TextInputManager* GetTextInputManager() override; TextInputManager* GetTextInputManager() override;
bool OnUpdateDragCursor() override; bool OnUpdateDragCursor() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment