refactor: BrowserView is owned by a BaseWindow (#35511)

This commit is contained in:
Jeremy Rose 2022-08-31 17:40:02 -07:00 committed by GitHub
parent 9cdc8bf6ca
commit f99122abfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 71 additions and 73 deletions

View file

@ -31,6 +31,7 @@ class Dictionary;
namespace electron::api {
class WebContents;
class BaseWindow;
class BrowserView : public gin::Wrappable<BrowserView>,
public gin_helper::Constructible<BrowserView>,
@ -51,9 +52,9 @@ class BrowserView : public gin::Wrappable<BrowserView>,
WebContents* web_contents() const { return api_web_contents_; }
NativeBrowserView* view() const { return view_.get(); }
NativeWindow* owner_window() const { return owner_window_.get(); }
BaseWindow* owner_window() const { return owner_window_.get(); }
void SetOwnerWindow(NativeWindow* window);
void SetOwnerWindow(BaseWindow* window);
int32_t ID() const { return id_; }
@ -83,7 +84,7 @@ class BrowserView : public gin::Wrappable<BrowserView>,
class WebContents* api_web_contents_ = nullptr;
std::unique_ptr<NativeBrowserView> view_;
base::WeakPtr<NativeWindow> owner_window_;
base::WeakPtr<BaseWindow> owner_window_;
int32_t id_;
};