Fix build on Linux

This commit is contained in:
Cheng Zhao 2017-08-21 17:42:45 +09:00
parent 19323c88f9
commit 70fd42808e

View file

@ -309,9 +309,11 @@ NativeWindowViews::NativeWindowViews(
// we should check whether setting it in InitParams can work. // we should check whether setting it in InitParams can work.
window_->set_frame_type(views::Widget::FrameType::FRAME_TYPE_FORCE_NATIVE); window_->set_frame_type(views::Widget::FrameType::FRAME_TYPE_FORCE_NATIVE);
window_->FrameTypeChanged(); window_->FrameTypeChanged();
#if defined(OS_WIN)
// thickFrame also works for normal window. // thickFrame also works for normal window.
if (!thick_frame_) if (!thick_frame_)
FlipWindowStyle(GetAcceleratedWidget(), false, WS_THICKFRAME); FlipWindowStyle(GetAcceleratedWidget(), false, WS_THICKFRAME);
#endif
} }
gfx::Size size = bounds.size(); gfx::Size size = bounds.size();
@ -580,11 +582,15 @@ gfx::Size NativeWindowViews::GetContentSize() {
void NativeWindowViews::SetContentSizeConstraints( void NativeWindowViews::SetContentSizeConstraints(
const extensions::SizeConstraints& size_constraints) { const extensions::SizeConstraints& size_constraints) {
NativeWindow::SetContentSizeConstraints(size_constraints); NativeWindow::SetContentSizeConstraints(size_constraints);
#if defined(OS_WIN)
// Changing size constraints would force adding the WS_THICKFRAME style, so // Changing size constraints would force adding the WS_THICKFRAME style, so
// do nothing if thickFrame is false. // do nothing if thickFrame is false.
if (!thick_frame_)
return;
#endif
// widget_delegate() is only available after Init() is called, we make use of // widget_delegate() is only available after Init() is called, we make use of
// this to determine whether native widget has initialized. // this to determine whether native widget has initialized.
if (thick_frame_ && window_ && window_->widget_delegate()) if (window_ && window_->widget_delegate())
window_->OnSizeConstraintsChanged(); window_->OnSizeConstraintsChanged();
#if defined(USE_X11) #if defined(USE_X11)
if (resizable_) if (resizable_)