Add callback to allow Document PiP moveTo/By() (fixes #3714)

Allow Document picture-in-picture moveTo/By() and resizeTo/By()
(without user gesture) if the new
CefBrowserViewDelegate::AllowMoveForPictureInPicture callback
returns true.
This commit is contained in:
Marshall Greenblatt
2025-04-22 14:05:23 +00:00
parent d746017d7c
commit 77f2451a5e
28 changed files with 318 additions and 148 deletions

View File

@@ -12,6 +12,7 @@
#include "cef/include/internal/cef_ptr.h"
#include "cef/libcef/common/mojom/cef.mojom.h"
#include "cef/libcef/renderer/browser_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
@@ -52,12 +53,10 @@ class CefRenderManager : public cef::mojom::RenderManager {
void RenderFrameCreated(content::RenderFrame* render_frame,
CefRenderFrameObserver* render_frame_observer,
bool& browser_created,
std::optional<bool>& is_windowless,
std::optional<bool>& print_preview_enabled);
std::optional<cef::BrowserConfig>& config);
void WebViewCreated(blink::WebView* web_view,
bool& browser_created,
std::optional<bool>& is_windowless,
std::optional<bool>& print_preview_enabled);
std::optional<cef::BrowserConfig>& config);
void DevToolsAgentAttached();
void DevToolsAgentDetached();
void ExposeInterfacesToBrowser(mojo::BinderMap* binders);
@@ -94,9 +93,8 @@ class CefRenderManager : public cef::mojom::RenderManager {
CefRefPtr<CefBrowserImpl> MaybeCreateBrowser(
blink::WebView* web_view,
content::RenderFrame* render_frame,
bool* browser_created,
std::optional<bool>* is_windowless,
std::optional<bool>* print_preview_enabled);
bool& browser_created,
std::optional<cef::BrowserConfig>& config);
// Called from CefBrowserImpl::OnDestruct().
void OnBrowserDestroyed(CefBrowserImpl* browser);