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

Side by Side Diff: ui/base/cocoa/underlay_opengl_hosting_window.mm

Issue 10545050: mac: Use NSWidth() and friends in a few more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/cocoa/base_view_unittest.mm ('k') | ui/gfx/platform_font_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" 5 #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // - It causes console spew: <http://crbug.com/78973> 92 // - It causes console spew: <http://crbug.com/78973>
93 // - It breaks Expose: <http://sourceforge.net/projects/heat-meteo/forums/foru m/268087/topic/4582610> 93 // - It breaks Expose: <http://sourceforge.net/projects/heat-meteo/forums/foru m/268087/topic/4582610>
94 // 94 //
95 // This is a banned practice 95 // This is a banned practice
96 // <http://www.chromium.org/developers/coding-style/cocoa-dos-and-donts>. Do 96 // <http://www.chromium.org/developers/coding-style/cocoa-dos-and-donts>. Do
97 // not do this. Use kWindowSizeDeterminedLater in 97 // not do this. Use kWindowSizeDeterminedLater in
98 // ui/base/cocoa/window_size_constants.h instead. 98 // ui/base/cocoa/window_size_constants.h instead.
99 // 99 //
100 // (This is checked here because UnderlayOpenGLHostingWindow is the base of 100 // (This is checked here because UnderlayOpenGLHostingWindow is the base of
101 // most Chromium windows, not because this is related to its functionality.) 101 // most Chromium windows, not because this is related to its functionality.)
102 DCHECK(contentRect.size.width > 0 && 102 DCHECK(!NSIsEmptyRect(contentRect));
103 contentRect.size.height > 0);
104 if ((self = [super initWithContentRect:contentRect 103 if ((self = [super initWithContentRect:contentRect
105 styleMask:windowStyle 104 styleMask:windowStyle
106 backing:bufferingType 105 backing:bufferingType
107 defer:deferCreation])) { 106 defer:deferCreation])) {
108 if (base::mac::IsOSSnowLeopardOrLater()) { 107 if (base::mac::IsOSSnowLeopardOrLater()) {
109 // Hole punching is used when IOSurfaces are used to transport, which is 108 // Hole punching is used when IOSurfaces are used to transport, which is
110 // only on > 10.5. Therefore, on > 10.5, the window must always be 109 // only on > 10.5. Therefore, on > 10.5, the window must always be
111 // non-opaque whether or not it's titled if we want hole punching to work. 110 // non-opaque whether or not it's titled if we want hole punching to work.
112 [self setOpaque:NO]; 111 [self setOpaque:NO];
113 112
(...skipping 28 matching lines...) Expand all
142 [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough]; 141 [rightOpaque setAlphaValue:kAlphaValueJustOpaqueEnough];
143 [rootView addSubview:rightOpaque]; 142 [rootView addSubview:rightOpaque];
144 } 143 }
145 } 144 }
146 } 145 }
147 146
148 return self; 147 return self;
149 } 148 }
150 149
151 @end 150 @end
OLDNEW
« no previous file with comments | « ui/base/cocoa/base_view_unittest.mm ('k') | ui/gfx/platform_font_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698