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

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10823008: [mac] In app windows, calculate the window corner radius programmatically. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index 479114c31a81bbb470f150af05ffa3fdd2f05708..1a1f3f3bec508737533b3747d22649760b94bcd5 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -56,16 +56,26 @@
@end
+// This is really a method on NSGrayFrame, so it should only be called on the
+// view passed into -[NSWindow drawCustomFrameRect:forView:].
+@interface NSView (PrivateMethods)
+- (float)roundedCornerRadius;
Robert Sesek 2012/07/25 23:25:36 This probably returns CGFloat
jeremya 2012/07/25 23:36:38 Done.
+@end
+
@implementation ShellNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
[[NSBezierPath bezierPathWithRect:rect] addClip];
[[NSColor clearColor] set];
NSRectFill(rect);
- const CGFloat kWindowBorderRadius = 3.0;
+
+ // Set up our clip.
+ float cornerRadius = 4.0;
Robert Sesek 2012/07/25 23:25:36 I'd keep this as CGFlaot. Also, why the change fr
jeremya 2012/07/25 23:36:38 Done.
+ if ([view respondsToSelector:@selector(roundedCornerRadius)])
+ cornerRadius = [view roundedCornerRadius];
[[NSBezierPath bezierPathWithRoundedRect:[view bounds]
- xRadius:kWindowBorderRadius
- yRadius:kWindowBorderRadius] addClip];
+ xRadius:cornerRadius
+ yRadius:cornerRadius] addClip];
[[NSColor whiteColor] set];
NSRectFill(rect);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698