From ddb2b069ace569857506c03cf893cdabfab64d6f Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sat, 22 Nov 2025 02:38:56 -0800 Subject: [PATCH] fix: delegate GetSize() and Resize() to WebContentsView Upstream delegated WebContents::GetSize() and Resize() to WebContentsView. - GetSize() now requires const override - Resize() is a new required method Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7155287 --- shell/browser/osr/osr_web_contents_view.cc | 7 ++++++- shell/browser/osr/osr_web_contents_view.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/shell/browser/osr/osr_web_contents_view.cc b/shell/browser/osr/osr_web_contents_view.cc index 99991fee12..a10f392e8b 100644 --- a/shell/browser/osr/osr_web_contents_view.cc +++ b/shell/browser/osr/osr_web_contents_view.cc @@ -70,10 +70,15 @@ void OffScreenWebContentsView::OnWindowClosed() { } } -gfx::Size OffScreenWebContentsView::GetSize() { +gfx::Size OffScreenWebContentsView::GetSize() const { return native_window_ ? native_window_->GetSize() : gfx::Size(); } +void OffScreenWebContentsView::Resize(const gfx::Rect& new_bounds) { + // OSR doesn't support resize via this method - it uses SetSize on the view + // directly. This is a no-op to satisfy the interface. +} + #if !BUILDFLAG(IS_MAC) gfx::NativeView OffScreenWebContentsView::GetNativeView() const { if (!native_window_) diff --git a/shell/browser/osr/osr_web_contents_view.h b/shell/browser/osr/osr_web_contents_view.h index 364fabff78..28210b373b 100644 --- a/shell/browser/osr/osr_web_contents_view.h +++ b/shell/browser/osr/osr_web_contents_view.h @@ -48,7 +48,8 @@ class OffScreenWebContentsView : public content::WebContentsView, void OnWindowResize() override; void OnWindowClosed() override; - gfx::Size GetSize(); + gfx::Size GetSize() const override; + void Resize(const gfx::Rect& new_bounds) override; // content::WebContentsView: gfx::NativeView GetNativeView() const override;