mirror of
https://github.com/electron/electron.git
synced 2026-01-07 22:54:25 -05:00
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:
@@ -70,7 +70,7 @@ void OffScreenWebContentsView::OnWindowClosed() {
|
||||
}
|
||||
}
|
||||
|
||||
gfx::Size OffScreenWebContentsView::GetSize() {
|
||||
gfx::Size OffScreenWebContentsView::GetSize() const {
|
||||
return native_window_ ? native_window_->GetSize() : gfx::Size();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user