summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 19:11:03 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-10 19:11:03 +0000
commitc7b7353decb770928f58da71659be26c93f23a34 (patch)
treec76b79984c4b1cbc32d8bfab0264e43c63471e86 /chrome/browser
parente759c4be6a26f6cc192b5edcc830bd1408fab87c (diff)
downloadchromium_src-c7b7353decb770928f58da71659be26c93f23a34.zip
chromium_src-c7b7353decb770928f58da71659be26c93f23a34.tar.gz
chromium_src-c7b7353decb770928f58da71659be26c93f23a34.tar.bz2
Mac: Make background tabs draw properly in fullscreen mode.
(Things still look a bit off due to the lack of a gradient, but that's a separate issue.) BUG=35960 TEST=Make sure background tabs look the same as before in normal (non-fullscreen) mode, both when the window is active and when it isn't. Make sure background tabs look approximately correct in fullscreen mode, both when the fullscreen window is active and when it isn't (for the latter, make the floating bar visible by focusing the Omnibox, and switch to another app using Cmd-`); note that it won't look exactly right since we're still missing a gradient. Review URL: http://codereview.chromium.org/661295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/fullscreen_window.mm12
-rw-r--r--chrome/browser/cocoa/tab_view.mm5
2 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/fullscreen_window.mm b/chrome/browser/cocoa/fullscreen_window.mm
index bcc4d93..dd94c6b 100644
--- a/chrome/browser/cocoa/fullscreen_window.mm
+++ b/chrome/browser/cocoa/fullscreen_window.mm
@@ -44,6 +44,18 @@
return YES;
}
+// When becoming/resigning main status, explicitly set the background color,
+// which is required by |TabView|.
+- (void)becomeMainWindow {
+ [super becomeMainWindow];
+ [self setBackgroundColor:[NSColor windowFrameColor]];
+}
+
+- (void)resignMainWindow {
+ [super resignMainWindow];
+ [self setBackgroundColor:[NSColor windowBackgroundColor]];
+}
+
// We need our own version, since the default one wants to flash the close
// button (and possibly other things), which results in nothing happening.
- (void)performClose:(id)sender {
diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm
index 8e5c888..b403f74 100644
--- a/chrome/browser/cocoa/tab_view.mm
+++ b/chrome/browser/cocoa/tab_view.mm
@@ -669,7 +669,10 @@ const CGFloat kRapidCloseDist = 2.5;
[backgroundImageColor set];
[path fill];
} else {
- [[NSColor windowBackgroundColor] set];
+ // Use the window's background color rather than |[NSColor
+ // windowBackgroundColor]|, which gets confused by the fullscreen window.
+ // (The result is the same for normal, non-fullscreen windows.)
+ [[[self window] backgroundColor] set];
[path fill];
[[NSColor colorWithCalibratedWhite:1.0 alpha:0.3] set];
[path fill];