Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: ui/views/widget/native_widget_mac.mm

Issue 927233003: MacViews: Fix positioning of top-level Widgets with parents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150129-MacViews-Bringup5
Patch Set: Added comment to BridgedNativeWidget Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_widget_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]);
« no previous file with comments | « ui/views/widget/desktop_widget_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698