macOS: Use sheet window as modal window
This commit is contained in:
parent
1866dbe608
commit
e33e4be257
8 changed files with 81 additions and 112 deletions
|
@ -100,7 +100,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual bool IsVisible() = 0;
|
||||
virtual void Disable();
|
||||
virtual void Enable();
|
||||
virtual void SetEnabled(bool enable) = 0; // should not be used
|
||||
virtual void SetEnabled(bool enable) = 0; // internal API, should not be used
|
||||
virtual bool IsEnabled() = 0;
|
||||
virtual void Maximize() = 0;
|
||||
virtual void Unmaximize() = 0;
|
||||
|
@ -163,10 +163,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual void SetFocusable(bool focusable);
|
||||
virtual void SetMenu(ui::MenuModel* menu);
|
||||
virtual bool HasModalDialog();
|
||||
virtual void SetParentWindow(NativeWindow* parent) = 0;
|
||||
virtual void BeginSheet(NativeWindow* sheet);
|
||||
virtual void EndSheet(NativeWindow* sheet);
|
||||
virtual void SetModal(bool modal) = 0;
|
||||
virtual void SetParentWindow(NativeWindow* parent);
|
||||
virtual gfx::NativeWindow GetNativeWindow() = 0;
|
||||
virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
|
||||
|
||||
|
@ -264,9 +261,13 @@ class NativeWindow : public base::SupportsUserData,
|
|||
has_dialog_attached_ = has_dialog_attached;
|
||||
}
|
||||
|
||||
NativeWindow* parent() const { return parent_; }
|
||||
bool is_modal() const { return is_modal_; }
|
||||
|
||||
protected:
|
||||
NativeWindow(brightray::InspectableWebContents* inspectable_web_contents,
|
||||
const mate::Dictionary& options);
|
||||
const mate::Dictionary& options,
|
||||
NativeWindow* parent);
|
||||
|
||||
// Convert draggable regions in raw format to SkRegion format. Caller is
|
||||
// responsible for deleting the returned SkRegion instance.
|
||||
|
@ -341,6 +342,12 @@ class NativeWindow : public base::SupportsUserData,
|
|||
// How many times the Disable has been called.
|
||||
int disable_count_;
|
||||
|
||||
// The parent window, it is guaranteed to be valid during this window's life.
|
||||
NativeWindow* parent_;
|
||||
|
||||
// Is this a modal window.
|
||||
bool is_modal_;
|
||||
|
||||
// The page this window is viewing.
|
||||
brightray::InspectableWebContents* inspectable_web_contents_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue