mac: Add API to return whether the window has attached sheet.

This commit is contained in:
Cheng Zhao 2013-12-04 16:32:32 +08:00
parent 7d5826df85
commit d6d1604623
4 changed files with 7 additions and 0 deletions

View file

@ -99,6 +99,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
virtual void FlashFrame(bool flash) = 0;
virtual void SetKiosk(bool kiosk) = 0;
virtual bool IsKiosk() = 0;
virtual bool HasModalDialog() = 0;
virtual gfx::NativeWindow GetNativeWindow() = 0;
virtual bool IsClosed() const { return is_closed_; }

View file

@ -53,6 +53,7 @@ class NativeWindowMac : public NativeWindow {
virtual void FlashFrame(bool flash) OVERRIDE;
virtual void SetKiosk(bool kiosk) OVERRIDE;
virtual bool IsKiosk() OVERRIDE;
virtual bool HasModalDialog() OVERRIDE;
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
void NotifyWindowBlur() { NativeWindow::NotifyWindowBlur(); }

View file

@ -387,6 +387,10 @@ bool NativeWindowMac::IsKiosk() {
return is_kiosk_;
}
bool NativeWindowMac::HasModalDialog() {
return [window() attachedSheet] != nil;
}
gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
return window();
}

View file

@ -65,6 +65,7 @@ class NativeWindowWin : public NativeWindow,
virtual void FlashFrame(bool flash) OVERRIDE;
virtual void SetKiosk(bool kiosk) OVERRIDE;
virtual bool IsKiosk() OVERRIDE;
virtual bool HasModalDialog() OVERRIDE;
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
void OnMenuCommand(int position, HMENU menu);