refactor: manage widget_ in NativeWindow

This commit is contained in:
Cheng Zhao 2018-04-25 16:05:43 +09:00
parent 727cd68cee
commit 2225cc9608
6 changed files with 22 additions and 29 deletions

View file

@ -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_;