Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm |
| index 09025681aa91818b635eac2631a7ae0fe6cf1c56..dba85d4f98f88218c49eed4eaccb512a5708c7ac 100644 |
| --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm |
| +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm |
| @@ -24,7 +24,8 @@ |
| // subview of the root view. It cannot be a subview of the contentView, as that |
| // would cause it to become layer backed, which would cause it to draw on top |
| // of non-layer backed content like the window controls. |
| -- (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window; |
| +- (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window |
| + titleBar:(BOOL)hasTitleBar; |
| @end |
| @interface TabWindowOverlayWindow : NSWindow |
| @@ -48,7 +49,8 @@ |
| @implementation TabWindowController |
| -- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip { |
| +- (id)initTabWindowControllerWithTabStrip:(BOOL)hasTabStrip |
| + titleBar:(BOOL)hasTitleBar { |
| const CGFloat kDefaultWidth = 750; |
| const CGFloat kDefaultHeight = 600; |
| @@ -88,7 +90,7 @@ |
| kBrowserFrameViewPaintHeight)]); |
| [tabStripBackgroundView_ |
| setAutoresizingMask:NSViewWidthSizable | NSViewMinYMargin]; |
| - [self insertTabStripBackgroundViewIntoWindow:window]; |
| + [self insertTabStripBackgroundViewIntoWindow:window titleBar:hasTitleBar]; |
| tabStripView_.reset([[TabStripView alloc] |
| initWithFrame:NSMakeRect( |
| @@ -335,7 +337,8 @@ |
| closeDeferred_ = YES; |
| } |
| -- (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window { |
| +- (void)insertTabStripBackgroundViewIntoWindow:(NSWindow*)window |
| + titleBar:(BOOL)hasTitleBar { |
| DCHECK(tabStripBackgroundView_); |
| NSView* rootView = [[window contentView] superview]; |
| @@ -350,6 +353,12 @@ |
| return; |
| } |
| + [window setTitlebarAppearsTransparent:YES]; |
|
shrike
2016/05/13 18:30:21
What happens in the title-bar case if you don't do
|
| + |
| + // If the window has a normal titlebar, then do not add NSVisualEffectView. |
| + if (hasTitleBar) |
| + return; |
| + |
| base::scoped_nsobject<NSVisualEffectView> visualEffectView( |
| [[nsVisualEffectViewClass alloc] |
| initWithFrame:[tabStripBackgroundView_ frame]]); |
| @@ -372,8 +381,6 @@ |
| [visualEffectView setBlendingMode:NSVisualEffectBlendingModeBehindWindow]; |
| [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; |
| - [window setTitlebarAppearsTransparent:YES]; |
| - |
| [rootView addSubview:visualEffectView |
| positioned:NSWindowBelow |
| relativeTo:nil]; |