win: Implement NativeWindowWin::HasModalDialog().
This commit is contained in:
parent
e43b39a009
commit
687c9de5d7
1 changed files with 16 additions and 0 deletions
|
@ -194,6 +194,17 @@ class NativeWindowFramelessView : public views::NonClientFrameView {
|
|||
DISALLOW_COPY_AND_ASSIGN(NativeWindowFramelessView);
|
||||
};
|
||||
|
||||
bool WindowHasModalDialog(HWND parent, HWND except, HWND after = NULL) {
|
||||
HWND hwnd = ::FindWindowEx(parent, after, NULL, NULL);
|
||||
if (hwnd != except &&
|
||||
(::GetWindowLong(hwnd, GWL_STYLE) & (WS_VISIBLE | WS_POPUP)))
|
||||
return true;
|
||||
else if (hwnd == NULL)
|
||||
return false;
|
||||
else
|
||||
return WindowHasModalDialog(parent, except, hwnd);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
NativeWindowWin::NativeWindowWin(content::WebContents* web_contents,
|
||||
|
@ -359,6 +370,11 @@ bool NativeWindowWin::IsKiosk() {
|
|||
return IsFullscreen();
|
||||
}
|
||||
|
||||
bool NativeWindowWin::HasModalDialog() {
|
||||
return WindowHasModalDialog(GetNativeWindow(),
|
||||
GetWebContents()->GetView()->GetNativeView());
|
||||
}
|
||||
|
||||
gfx::NativeWindow NativeWindowWin::GetNativeWindow() {
|
||||
return window_->GetNativeView();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue