refactor: manage widget_ in NativeWindow
This commit is contained in:
parent
727cd68cee
commit
2225cc9608
6 changed files with 22 additions and 29 deletions
|
@ -261,6 +261,8 @@ class NativeWindow : public base::SupportsUserData,
|
|||
observers_.RemoveObserver(obs);
|
||||
}
|
||||
|
||||
views::Widget* widget() const { return widget_.get(); }
|
||||
|
||||
bool has_frame() const { return has_frame_; }
|
||||
void set_has_frame(bool has_frame) { has_frame_ = has_frame; }
|
||||
|
||||
|
@ -274,11 +276,17 @@ class NativeWindow : public base::SupportsUserData,
|
|||
protected:
|
||||
NativeWindow(const mate::Dictionary& options, NativeWindow* parent);
|
||||
|
||||
// views::WidgetDelegate:
|
||||
views::Widget* GetWidget() override;
|
||||
const views::Widget* GetWidget() const override;
|
||||
|
||||
void set_browser_view(NativeBrowserView* browser_view) {
|
||||
browser_view_ = browser_view;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<views::Widget> widget_;
|
||||
|
||||
// Whether window has standard frame.
|
||||
bool has_frame_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue