win: Fix detecting attached modal dialog.

This commit is contained in:
Cheng Zhao 2014-02-10 20:07:38 +08:00
parent f4a2c12d75
commit 9ba7db8815
6 changed files with 37 additions and 19 deletions

View file

@ -194,17 +194,6 @@ 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,
@ -370,11 +359,6 @@ bool NativeWindowWin::IsKiosk() {
return IsFullscreen();
}
bool NativeWindowWin::HasModalDialog() {
return WindowHasModalDialog(GetNativeWindow(),
GetWebContents()->GetView()->GetNativeView());
}
gfx::NativeWindow NativeWindowWin::GetNativeWindow() {
return window_->GetNativeView();
}