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

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

Issue 2638873002: Revert of [Mac] Fix rough-looking profile picker text, especially with a dark theme. (Closed)
Patch Set: Created 3 years, 11 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/browser_window_fullscreen_transition.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.mm b/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.mm
index 43d28e1a25f315d7a26df76d7a43175453f67943..2855e87e91def96915e21aa82b3c0eceb4f9c9e3 100644
--- a/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.mm
+++ b/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.mm
@@ -54,6 +54,40 @@
} // namespace
+// This view draws a dummy toolbar over the resized content view during
+// the exit fullscreen animation. It is removed at the end of the animation.
+@interface FullscreenTabStripBackgroundView : NSView {
+ base::scoped_nsobject<NSColor> windowBackgroundColor_;
+}
+
+- (instancetype)initWithFrame:(NSRect)frame background:(NSColor*)color;
+
+@end
+
+@implementation FullscreenTabStripBackgroundView
+
+- (instancetype)initWithFrame:(NSRect)frame background:(NSColor*)color {
+ if ((self = [super initWithFrame:frame])) {
+ windowBackgroundColor_.reset([color copy]);
+ }
+ return self;
+}
+
+// Override this method so that we can paint the toolbar in this view.
+// This method first fill itself with the toolbar's background. After that,
+// it will paint the window's theme if applicable.
+- (void)drawRect:(NSRect)frame {
+ [windowBackgroundColor_ set];
+ NSRectFillUsingOperation(frame, NSCompositeDestinationOver);
+
+ [FramedBrowserWindow drawWindowThemeInDirtyRect:frame
+ forView:self
+ bounds:[self bounds]
+ forceBlackBackground:NO];
+}
+
+@end
+
@interface BrowserWindowFullscreenTransition ()
<CAAnimationDelegate, CALayerDelegate> {
// Flag to keep track of whether we are entering or exiting fullscreen.
@@ -100,7 +134,7 @@
NSRect finalFrame_;
// This view draws the tabstrip background during the exit animation.
- base::scoped_nsobject<TabStripBackgroundView>
+ base::scoped_nsobject<FullscreenTabStripBackgroundView>
fullscreenTabStripBackgroundView_;
// Locks and unlocks the FullSizeContentWindow.
@@ -328,7 +362,9 @@
[primaryWindow_ forceContentViewFrame:relativeContentFinalFrame];
fullscreenTabStripBackgroundView_.reset(
- [[TabStripBackgroundView alloc] initWithFrame:finalFrame_]);
+ [[FullscreenTabStripBackgroundView alloc]
+ initWithFrame:finalFrame_
+ background:primaryWindowInitialBackgroundColor_]);
[fullscreenTabStripBackgroundView_ setFrameOrigin:NSZeroPoint];
[contentView addSubview:fullscreenTabStripBackgroundView_.get()
positioned:NSWindowBelow
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_unittest.mm ('k') | chrome/browser/ui/cocoa/floating_bar_backing_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698