Chromium Code Reviews| Index: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
| index a4ad4eabc04d88a0f14caf214ffa876118597cd7..23c9868eed196217fa10cc7af24fd2b26f8fdbef 100644 |
| --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm |
| @@ -217,6 +217,27 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions( |
| return YES; |
| } |
| +- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view { |
| + // Make the background color of the content area white. We can't just call |
| + // -setBackgroundColor as that causes the title bar to be drawn in a solid |
| + // color. |
| + NSRect contentRect = [NSWindow contentRectForFrameRect:rect |
|
tapted
2014/06/17 06:09:51
I think you can use [self contentRectForFrameRect:
jackhou1
2014/06/17 07:00:14
Done.
|
| + styleMask:[self styleMask]]; |
| + [[NSColor whiteColor] set]; |
| + NSRectFill(contentRect); |
| + |
| + // Draw the native title bar. We clip the content area since the native |
| + // implementation draws a grey background. |
|
tapted
2014/06/17 06:09:52
nit: grey -> gray to be consistent with color :p
jackhou1
2014/06/17 07:00:14
Done.
|
| + NSRect titleBarRect = NSIntersectionRect(rect, |
| + NSMakeRect(NSMinX(contentRect), |
|
tapted
2014/06/17 06:09:51
I stared at the second argument for a while before
jackhou1
2014/06/17 07:00:14
Done.
|
| + NSMaxY(contentRect), |
| + NSWidth(contentRect), |
| + CGFLOAT_MAX)); |
| + [NSBezierPath clipRect:titleBarRect]; |
|
tapted
2014/06/17 06:09:52
It's possible clipping will be more expensive than
|
| + [super drawCustomFrameRect:rect |
| + forView:view]; |
| +} |
| + |
| @end |
| @interface ShellCustomFrameNSWindow : ShellNSWindow { |