Commit 1e0366fc authored by sadrul's avatar sadrul Committed by Commit bot

mus: Fix showing guest views in --mash and --mus.

It is necessary to notify the RenderWidgetHostViewChildFrame of the
surface associated with the child-frame, so that it can correctly notify
the embedder.

This fixes the login screen, opening pdf files in chrome, etc.

BUG=694846
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2804753002
Cr-Commit-Position: refs/heads/master@{#463372}
parent 8dd10d40
......@@ -411,6 +411,12 @@ void RenderWidgetHostViewChildFrame::OnBeginFrameDidNotSwap(
support_->BeginFrameDidNotSwap(ack);
}
void RenderWidgetHostViewChildFrame::OnSurfaceChanged(
const cc::SurfaceInfo& surface_info) {
cc::SurfaceSequence sequence(frame_sink_id_, next_surface_sequence_++);
SendSurfaceInfoToEmbedderImpl(surface_info, sequence);
}
void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() {
// We only use callbacks once, therefore we make a new list for registration
// before we start, and discard the old list entries when we are done.
......
......@@ -111,6 +111,7 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
cc::CompositorFrame frame) override;
void OnBeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override;
void OnSurfaceChanged(const cc::SurfaceInfo& surface_info) override;
// Since the URL of content rendered by this class is not displayed in
// the URL bar, this method does not need an implementation.
void ClearCompositorFrame() override {}
......
......@@ -1585,6 +1585,13 @@ bool RenderWidgetHostViewAura::HasHitTestMask() const {
void RenderWidgetHostViewAura::GetHitTestMask(gfx::Path* mask) const {
}
void RenderWidgetHostViewAura::OnWindowSurfaceChanged(
const cc::SurfaceInfo& surface_info) {
if (!is_guest_view_hack_)
return;
host_->GetView()->OnSurfaceChanged(surface_info);
}
////////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewAura, ui::EventHandler implementation:
......
......@@ -249,6 +249,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
void OnWindowTargetVisibilityChanged(bool visible) override;
bool HasHitTestMask() const override;
void GetHitTestMask(gfx::Path* mask) const override;
void OnWindowSurfaceChanged(const cc::SurfaceInfo& surface_info) override;
// Overridden from ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
......
......@@ -46,6 +46,7 @@ struct ViewHostMsg_SelectionBounds_Params;
namespace cc {
struct BeginFrameAck;
class SurfaceInfo;
} // namespace cc
namespace media {
......@@ -227,6 +228,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
cc::CompositorFrame frame) = 0;
virtual void OnBeginFrameDidNotSwap(const cc::BeginFrameAck& ack) {}
virtual void OnSurfaceChanged(const cc::SurfaceInfo& surface_info) {}
// This method exists to allow removing of displayed graphics, after a new
// page has been loaded, to prevent the displayed URL from being out of sync
......
......@@ -324,6 +324,8 @@ const cc::LocalSurfaceId& WindowPortMus::GetOrAllocateLocalSurfaceId(
void WindowPortMus::SetPrimarySurfaceInfo(const cc::SurfaceInfo& surface_info) {
primary_surface_info_ = surface_info;
UpdateClientSurfaceEmbedder();
if (window_->delegate())
window_->delegate()->OnWindowSurfaceChanged(surface_info);
}
void WindowPortMus::SetFallbackSurfaceInfo(
......@@ -528,11 +530,9 @@ void WindowPortMus::UpdatePrimarySurfaceInfo() {
if (!frame_sink_id_.is_valid() || !local_surface_id_.is_valid())
return;
primary_surface_info_ =
SetPrimarySurfaceInfo(
cc::SurfaceInfo(cc::SurfaceId(frame_sink_id_, local_surface_id_),
ScaleFactorForDisplay(window_), last_surface_size_);
UpdateClientSurfaceEmbedder();
ScaleFactorForDisplay(window_), last_surface_size_));
}
void WindowPortMus::UpdateClientSurfaceEmbedder() {
......
......@@ -12,6 +12,10 @@
#include "ui/events/event_handler.h"
#include "ui/gfx/native_widget_types.h"
namespace cc {
class SurfaceInfo;
}
namespace gfx {
class Path;
class Point;
......@@ -94,6 +98,8 @@ class AURA_EXPORT WindowDelegate : public ui::EventHandler {
// above returns true.
virtual void GetHitTestMask(gfx::Path* mask) const = 0;
virtual void OnWindowSurfaceChanged(const cc::SurfaceInfo& surface_info) {}
protected:
~WindowDelegate() 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