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

Unified Diff: chrome/browser/ui/cocoa/framed_browser_window.mm

Issue 329793003: Don't draw a window title on browser windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new 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
Index: chrome/browser/ui/cocoa/framed_browser_window.mm
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm
index 0989b6a543f296e73e36b5b2484fd6ef7cd14ef1..b916e46ffce7b3cf3d1f926d35885b68fe177a4a 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window.mm
@@ -36,7 +36,7 @@ const CGFloat kWindowGradientHeight = 24.0;
}
-@interface FramedBrowserWindow (Private)
+@interface FramedBrowserWindow ()
- (void)adjustCloseButton:(NSNotification*)notification;
- (void)adjustMiniaturizeButton:(NSNotification*)notification;
@@ -252,11 +252,18 @@ const CGFloat kWindowGradientHeight = 24.0;
}
- (void)setShouldHideTitle:(BOOL)flag {
- shouldHideTitle_ = flag;
+ if ([self respondsToSelector:@selector(setTitleVisibility:)])
+ self.titleVisibility = flag ? NSWindowTitleHidden : NSWindowTitleVisible;
+ else
+ shouldHideTitle_ = flag;
}
- (BOOL)_isTitleHidden {
- return shouldHideTitle_;
+ // Only intervene with 10.6-10.9.
+ if ([self respondsToSelector:@selector(setTitleVisibility:)])
+ return [super _isTitleHidden];
+ else
+ return shouldHideTitle_;
}
- (CGFloat)windowButtonsInterButtonSpacing {
@@ -349,9 +356,12 @@ const CGFloat kWindowGradientHeight = 24.0;
bounds:windowRect
forceBlackBackground:NO];
- // If the window needs a title and we painted over the title as drawn by the
- // default window paint, paint it ourselves.
- if (themed && [view respondsToSelector:@selector(_titlebarTitleRect)] &&
+ // In Yosemite: The title is drawn by a subview and not painted on. Therefore,
+ // never worry about drawing it. Pre-Yosemite: If the window needs a title and
+ // we painted over the title as drawn by the default window paint, paint it
+ // ourselves.
+ if (![self respondsToSelector:@selector(setTitleVisibility:)] &&
+ themed && [view respondsToSelector:@selector(_titlebarTitleRect)] &&
[view respondsToSelector:@selector(_drawTitleStringIn:withColor:)] &&
![self _isTitleHidden]) {
[view _drawTitleStringIn:[view _titlebarTitleRect]
« no previous file with comments | « chrome/browser/ui/cocoa/framed_browser_window.h ('k') | chrome/browser/ui/cocoa/framed_browser_window_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698