| 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]
|
|
|