remove unnecessary defines

This commit is contained in:
Cheng Zhao 2018-04-25 16:25:55 +09:00
parent e07ea24610
commit 089428857c
2 changed files with 8 additions and 15 deletions

View file

@ -606,14 +606,11 @@ void NativeWindowViews::SetContentSizeConstraints(
// this to determine whether native widget has initialized. // this to determine whether native widget has initialized.
if (widget() && widget()->widget_delegate()) if (widget() && widget()->widget_delegate())
widget()->OnSizeConstraintsChanged(); widget()->OnSizeConstraintsChanged();
#if defined(OS_WIN) || defined(USE_X11)
if (resizable_) if (resizable_)
old_size_constraints_ = size_constraints; old_size_constraints_ = size_constraints;
#endif
} }
void NativeWindowViews::SetResizable(bool resizable) { void NativeWindowViews::SetResizable(bool resizable) {
#if defined(OS_WIN) || defined(USE_X11)
if (resizable != resizable_) { if (resizable != resizable_) {
// On Linux there is no "resizable" property of a window, we have to set // On Linux there is no "resizable" property of a window, we have to set
// both the minimum and maximum size to the window size to achieve it. // both the minimum and maximum size to the window size to achieve it.
@ -627,7 +624,6 @@ void NativeWindowViews::SetResizable(bool resizable) {
extensions::SizeConstraints(content_size, content_size)); extensions::SizeConstraints(content_size, content_size));
} }
} }
#endif
#if defined(OS_WIN) #if defined(OS_WIN)
if (has_frame() && thick_frame_) if (has_frame() && thick_frame_)
FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME); FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME);
@ -650,11 +646,8 @@ bool NativeWindowViews::IsResizable() {
#if defined(OS_WIN) #if defined(OS_WIN)
if (has_frame()) if (has_frame())
return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME; return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME;
else
return CanResize();
#else
return CanResize();
#endif #endif
return CanResize();
} }
void NativeWindowViews::SetMovable(bool movable) { void NativeWindowViews::SetMovable(bool movable) {

View file

@ -215,6 +215,12 @@ class NativeWindowViews : public NativeWindow,
bool menu_bar_visible_; bool menu_bar_visible_;
bool menu_bar_alt_pressed_; bool menu_bar_alt_pressed_;
// The "resizable" flag on Linux is implemented by setting size constraints,
// we need to make sure size constraints are restored when window becomes
// resizable again. This is also used on Windows, to keep taskbar resize
// events from resizing the window.
extensions::SizeConstraints old_size_constraints_;
#if defined(USE_X11) #if defined(USE_X11)
std::unique_ptr<GlobalMenuBarX11> global_menu_bar_; std::unique_ptr<GlobalMenuBarX11> global_menu_bar_;
@ -224,13 +230,7 @@ class NativeWindowViews : public NativeWindow,
// To disable the mouse events. // To disable the mouse events.
std::unique_ptr<EventDisabler> event_disabler_; std::unique_ptr<EventDisabler> event_disabler_;
#endif #endif
#if defined(OS_WIN) || defined(USE_X11)
// The "resizable" flag on Linux is implemented by setting size constraints,
// we need to make sure size constraints are restored when window becomes
// resizable again. This is also used on Windows, to keep taskbar resize
// events from resizing the window.
extensions::SizeConstraints old_size_constraints_;
#endif
#if defined(OS_WIN) #if defined(OS_WIN)
// Weak ref. // Weak ref.
AtomDesktopWindowTreeHostWin* atom_desktop_window_tree_host_win_; AtomDesktopWindowTreeHostWin* atom_desktop_window_tree_host_win_;