1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
7 #include "base/logging.h"
9 @implementation UnderlayOpenGLHostingWindow
11 - (id)initWithContentRect:(NSRect)contentRect
12 styleMask:(NSUInteger)windowStyle
13 backing:(NSBackingStoreType)bufferingType
14 defer:(BOOL)deferCreation {
15 // It is invalid to create windows with zero width or height. It screws things
17 // - It causes console spew: <http://crbug.com/78973>
18 // - It breaks Expose: <http://sourceforge.net/projects/heat-meteo/forums/forum/268087/topic/4582610>
20 // This is a banned practice
21 // <http://www.chromium.org/developers/coding-style/cocoa-dos-and-donts>. Do
22 // not do this. Use kWindowSizeDeterminedLater in
23 // ui/base/cocoa/window_size_constants.h instead.
25 // (This is checked here because UnderlayOpenGLHostingWindow is the base of
26 // most Chromium windows, not because this is related to its functionality.)
27 DCHECK(!NSIsEmptyRect(contentRect));
28 self = [super initWithContentRect:contentRect