fix close button

This commit is contained in:
Jeremy Rose
2022-09-15 10:40:45 -07:00
parent fdc2151a63
commit 2de4fc7129
2 changed files with 6 additions and 1 deletions

View File

@@ -132,7 +132,7 @@ BrowserWindow::~BrowserWindow() {
host->GetWidget()->RemoveInputEventObserver(this);
api_web_contents_->RemoveObserver(this);
// Destroy the WebContents.
api_web_contents_->Destroy();
OnCloseContents();
}
}
@@ -178,6 +178,10 @@ void BrowserWindow::WebContentsDestroyed() {
CloseImmediately();
}
void BrowserWindow::OnCloseContents() {
api_web_contents_->Destroy();
}
void BrowserWindow::OnRendererResponsive(content::RenderProcessHost*) {
window_unresponsive_closure_.Cancel();
Emit("responsive");

View File

@@ -56,6 +56,7 @@ class BrowserWindow : public BaseWindow,
void WebContentsDestroyed() override;
// ExtendedWebContentsObserver:
void OnCloseContents() override;
void OnDraggableRegionsUpdated(
const std::vector<mojom::DraggableRegionPtr>& regions) override;
void OnSetContentBounds(const gfx::Rect& rect) override;