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

Unified Diff: chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm

Issue 338773002: [Mac] Make app window backgrounds white. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 6 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 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/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 6850748fbe7008b9dae379a85fb858de4733f633..9b45321337491a7656c546ca7cfae20707401d31 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
@@ -236,6 +236,25 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions(
return YES;
}
+- (void)drawCustomFrameRect:(NSRect)frameRect 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 rect = [self contentRectForFrameRect:frameRect];
+ [[NSColor whiteColor] set];
+ NSRectFill(rect);
+
+ // Draw the native title bar. We remove the content area since the native
+ // implementation draws a gray background.
+ rect.origin.y = NSMaxY(rect);
+ rect.size.height = CGFLOAT_MAX;
+ rect = NSIntersectionRect(rect, frameRect);
+
+ [NSBezierPath clipRect:rect];
+ [super drawCustomFrameRect:frameRect
+ forView:view];
+}
+
@end
@interface ShellCustomFrameNSWindow : ShellNSWindow {
« 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