Chromium Code Reviews| Index: ui/views/widget/native_widget_mac.mm |
| diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm |
| index eaad5c99e7634d52f00938be3178683009346bfc..3ab80874b11adcee58254d25da59172dd4847f7c 100644 |
| --- a/ui/views/widget/native_widget_mac.mm |
| +++ b/ui/views/widget/native_widget_mac.mm |
| @@ -22,6 +22,9 @@ |
| namespace views { |
| namespace { |
| +// The value used to represent an unbounded width or height. |
| +const int kUnboundedSize = 0; |
| + |
| NSInteger StyleMaskForParams(const Widget::InitParams& params) { |
| // TODO(tapted): Determine better masks when there are use cases for it. |
| if (params.remove_standard_frame) |
| @@ -526,7 +529,19 @@ bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { |
| } |
| void NativeWidgetMac::OnSizeConstraintsChanged() { |
|
tapted
2015/03/20 12:12:53
Aura widgets also call this towards the end of Ini
jackhou1
2015/03/25 23:32:23
ChromeNativeAppWindowViews::InitializeDefaultWindo
|
| - NOTIMPLEMENTED(); |
| + NSWindow* window = GetNativeWindow(); |
| + gfx::Size minimum_size = delegate()->GetMinimumSize(); |
| + [window setContentMinSize:NSMakeSize(minimum_size.width(), |
| + minimum_size.height())]; |
| + |
| + gfx::Size maximum_size = delegate()->GetMaximumSize(); |
| + CGFloat max_width = maximum_size.width() == kUnboundedSize |
| + ? CGFLOAT_MAX |
| + : maximum_size.width(); |
| + CGFloat max_height = maximum_size.height() == kUnboundedSize |
| + ? CGFLOAT_MAX |
| + : maximum_size.height(); |
| + [window setContentMaxSize:NSMakeSize(max_width, max_height)]; |
| } |
| void NativeWidgetMac::RepostNativeEvent(gfx::NativeEvent native_event) { |