win: Implement win.disable/enable/isEnabled() API

This commit is contained in:
Cheng Zhao 2016-06-19 12:18:48 +09:00
parent a6c4bf098b
commit 4c3c4437da

View file

@ -187,6 +187,9 @@ NativeWindowViews::NativeWindowViews(
if (options.Get(options::kFocusable, &focusable) && !focusable)
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
if (parent)
params.parent = parent->GetNativeWindow();
#if defined(OS_WIN)
params.native_widget =
new views::DesktopNativeWidgetAura(window_.get());
@ -376,13 +379,15 @@ bool NativeWindowViews::IsVisible() {
}
void NativeWindowViews::Disable() {
::EnableWindow(GetAcceleratedWidget(), FALSE);
}
void NativeWindowViews::Enable() {
::EnableWindow(GetAcceleratedWidget(), TRUE);
}
bool NativeWindowViews::IsEnabled() {
return true;
return ::IsWindowEnabled(GetAcceleratedWidget());
}
void NativeWindowViews::Maximize() {