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 564494ea26fba075aee81fde8c97f24b38dba5aa..20db395761ee684482da88635be05860871c89e4 100644 |
--- a/ui/views/widget/native_widget_mac.mm |
+++ b/ui/views/widget/native_widget_mac.mm |
@@ -9,6 +9,7 @@ |
#include "base/mac/foundation_util.h" |
#include "base/mac/scoped_nsobject.h" |
#include "base/strings/sys_string_conversions.h" |
+#import "ui/base/cocoa/window_size_constants.h" |
#include "ui/gfx/font_list.h" |
#import "ui/gfx/mac/coordinate_conversion.h" |
#include "ui/native_theme/native_theme.h" |
@@ -33,19 +34,6 @@ NSInteger StyleMaskForParams(const Widget::InitParams& params) { |
return NSBorderlessWindowMask; |
} |
-NSRect ValidateContentRect(NSRect content_rect) { |
- // A contentRect with zero width or height is a banned practice in Chrome, due |
- // to unpredictable OSX treatment. For now, silently give a minimum dimension. |
- // TODO(tapted): Add a DCHECK, or add emulation logic (e.g. to auto-hide). |
- if (NSWidth(content_rect) == 0) |
- content_rect.size.width = 1; |
- |
- if (NSHeight(content_rect) == 0) |
- content_rect.size.height = 1; |
- |
- return content_rect; |
-} |
- |
gfx::Size WindowSizeForClientAreaSize(NSWindow* window, const gfx::Size& size) { |
NSRect content_rect = NSMakeRect(0, 0, size.width(), size.height()); |
NSRect frame_rect = [window frameRectForContentRect:content_rect]; |
@@ -99,12 +87,8 @@ void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) { |
ownership_ = params.ownership; |
NSInteger style_mask = StyleMaskForParams(params); |
- NSRect content_rect = ValidateContentRect( |
- [NSWindow contentRectForFrameRect:gfx::ScreenRectToNSRect(params.bounds) |
- styleMask:style_mask]); |
- |
base::scoped_nsobject<NSWindow> window([[NativeWidgetMacNSWindow alloc] |
- initWithContentRect:content_rect |
+ initWithContentRect:ui::kWindowSizeDeterminedLater |
styleMask:style_mask |
backing:NSBackingStoreBuffered |
defer:YES]); |