mirror of
https://github.com/electron/electron.git
synced 2026-02-26 03:01:17 -05:00
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:
@@ -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_)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user