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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_window_controller.mm

Issue 1974733003: [Material][Mac] Remove NSVisualEffectView from windows with titlebars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « chrome/browser/ui/cocoa/tabs/tab_window_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_window_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698