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
This commit is contained in:
Samuel Attard
2025-11-22 02:38:56 -08:00
parent 50d2f98929
commit ddb2b069ac
2 changed files with 8 additions and 2 deletions

View File

@@ -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_)

View File

@@ -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;