Commit f3031b85 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[PiP] Remove EmbedSurface

Remove EmbedSurface from the public PictureInPictureWindowController
API because it should not be used outside //content.

BUG=953957

Change-Id: Id960a662885da94a5d20ac9c90efd7805547f6cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665654Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671454}
parent 759d00eb
......@@ -35,12 +35,6 @@ void ArcPictureInPictureWindowControllerImpl::OnWindowDestroyed() {
// Should be a no-op on ARC. This is managed on the Android side.
}
void ArcPictureInPictureWindowControllerImpl::EmbedSurface(
const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) {
// Should be a no-op on ARC. This is managed on the Android side.
}
content::OverlayWindow*
ArcPictureInPictureWindowControllerImpl::GetWindowForTesting() {
// Should be a no-op on ARC. This is managed on the Android side.
......
......@@ -34,8 +34,6 @@ class ArcPictureInPictureWindowControllerImpl
void Close(bool should_pause_video) override;
void CloseAndFocusInitiator() override;
void OnWindowDestroyed() override;
void EmbedSurface(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
content::OverlayWindow* GetWindowForTesting() override;
void UpdateLayerBounds() override;
bool IsPlayerActive() override;
......
......@@ -72,7 +72,6 @@ class MockPictureInPictureWindowController
MOCK_METHOD1(Close, void(bool));
MOCK_METHOD0(CloseAndFocusInitiator, void());
MOCK_METHOD0(OnWindowDestroyed, void());
MOCK_METHOD2(EmbedSurface, void(const viz::SurfaceId&, const gfx::Size&));
MOCK_METHOD0(GetWindowForTesting, content::OverlayWindow*());
MOCK_METHOD0(UpdateLayerBounds, void());
MOCK_METHOD0(IsPlayerActive, bool());
......@@ -1379,11 +1378,10 @@ IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest,
{
WidgetBoundsChangeWaiter waiter(overlay_window);
window_controller()->EmbedSurface(
viz::SurfaceId(
viz::FrameSinkId(1, 1),
viz::LocalSurfaceId(9, base::UnguessableToken::Create())),
gfx::Size(200, 100));
overlay_window->SetSurfaceId(viz::SurfaceId(
viz::FrameSinkId(1, 1),
viz::LocalSurfaceId(9, base::UnguessableToken::Create())));
overlay_window->UpdateVideoSize(gfx::Size(200, 100));
waiter.Wait();
}
......
......@@ -50,8 +50,6 @@ class PictureInPictureWindowControllerImpl
CONTENT_EXPORT void Close(bool should_pause_video) override;
CONTENT_EXPORT void CloseAndFocusInitiator() override;
CONTENT_EXPORT void OnWindowDestroyed() override;
CONTENT_EXPORT void EmbedSurface(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) override;
CONTENT_EXPORT OverlayWindow* GetWindowForTesting() override;
CONTENT_EXPORT void UpdateLayerBounds() override;
CONTENT_EXPORT bool IsPlayerActive() override;
......@@ -86,6 +84,10 @@ class PictureInPictureWindowControllerImpl
// state of this object.
void UpdateMediaPlayerId();
// Embeds a surface in the Picture-in-Picture window.
void EmbedSurface(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size);
// Sets the active Picture-in-Picture session associated with the controller.
// This is different from the service's active session as there is one
// controller per WebContents and one service per RenderFrameHost.
......
......@@ -7,14 +7,6 @@
#include "content/common/content_export.h"
namespace gfx {
class Size;
} // namespace gfx
namespace viz {
class SurfaceId;
} // namespace viz
namespace content {
class OverlayWindow;
class WebContents;
......@@ -48,8 +40,6 @@ class PictureInPictureWindowController {
// window was requested to be closed and destroyed by the system.
virtual void OnWindowDestroyed() = 0;
virtual void EmbedSurface(const viz::SurfaceId& surface_id,
const gfx::Size& natural_size) = 0;
virtual OverlayWindow* GetWindowForTesting() = 0;
virtual void UpdateLayerBounds() = 0;
virtual bool IsPlayerActive() = 0;
......
......@@ -626,11 +626,6 @@ PictureInPictureResult Shell::EnterPictureInPicture(
// tests to run accordingly.
if (!switches::IsRunWebTestsSwitchPresent())
return PictureInPictureResult::kNotSupported;
auto* controller =
PictureInPictureWindowController::GetOrCreateForWebContents(web_contents);
controller->EmbedSurface(surface_id, natural_size);
return PictureInPictureResult::kSuccess;
}
......
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