7155287: implement WebContentsView::GetSize and Resize

Upstream delegated WebContents::GetSize() and Resize() to WebContentsView,
making them pure virtual. Add const qualifier to GetSize() and implement
the Resize() override in OffScreenWebContentsView (no-op for offscreen).

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7155287
This commit is contained in:
Samuel Attard
2025-11-24 16:27:09 -08:00
parent 8350d152f9
commit 084eaa568e
2 changed files with 3 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ void OffScreenWebContentsView::OnWindowClosed() {
}
}
gfx::Size OffScreenWebContentsView::GetSize() {
gfx::Size OffScreenWebContentsView::GetSize() const {
return native_window_ ? native_window_->GetSize() : gfx::Size();
}

View File

@@ -48,7 +48,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
void OnWindowResize() override;
void OnWindowClosed() override;
gfx::Size GetSize();
gfx::Size GetSize() const override;
// content::WebContentsView:
gfx::NativeView GetNativeView() const override;
@@ -56,6 +56,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
gfx::NativeWindow GetTopLevelNativeWindow() const override;
gfx::Rect GetContainerBounds() const override;
void Focus() override {}
void Resize(const gfx::Rect& new_bounds) override {}
void SetInitialFocus() override {}
void StoreFocus() override {}
void RestoreFocus() override {}