refactor: BrowserView is owned by a BaseWindow (#35511)
This commit is contained in:
parent
9cdc8bf6ca
commit
f99122abfc
7 changed files with 71 additions and 73 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "content/browser/renderer_host/render_widget_host_view_base.h" // nogncheck
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "shell/browser/api/electron_api_base_window.h"
|
||||
#include "shell/browser/api/electron_api_web_contents.h"
|
||||
#include "shell/browser/browser.h"
|
||||
#include "shell/browser/native_browser_view.h"
|
||||
|
@ -99,10 +100,10 @@ BrowserView::BrowserView(gin::Arguments* args,
|
|||
NativeBrowserView::Create(api_web_contents_->inspectable_web_contents()));
|
||||
}
|
||||
|
||||
void BrowserView::SetOwnerWindow(NativeWindow* window) {
|
||||
void BrowserView::SetOwnerWindow(BaseWindow* window) {
|
||||
// Ensure WebContents and BrowserView owner windows are in sync.
|
||||
if (web_contents())
|
||||
web_contents()->SetOwnerWindow(window);
|
||||
web_contents()->SetOwnerWindow(window ? window->window() : nullptr);
|
||||
|
||||
owner_window_ = window ? window->GetWeakPtr() : nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue