summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_provider_mac.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 22:41:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 22:41:00 +0000
commit1c2b7b515d5e0304101cdac212d37bf5a554a38e (patch)
treecbf960ae1f276acae179c0b9a24b141bc901d6b0 /chrome/browser/browser_theme_provider_mac.mm
parente505a900d371c2012fd32a6d763ae283a98f72a1 (diff)
downloadchromium_src-1c2b7b515d5e0304101cdac212d37bf5a554a38e.zip
chromium_src-1c2b7b515d5e0304101cdac212d37bf5a554a38e.tar.gz
chromium_src-1c2b7b515d5e0304101cdac212d37bf5a554a38e.tar.bz2
Finishing removal of GTMTheme. All incognito drawing is now correct, themed or not.
BUG=http://crbug.com/35554 ; http://crbug.com/18568 TEST=everything should still work, all themes should draw correctly Review URL: http://codereview.chromium.org/661206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40173 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider_mac.mm')
-rw-r--r--chrome/browser/browser_theme_provider_mac.mm36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/browser_theme_provider_mac.mm b/chrome/browser/browser_theme_provider_mac.mm
index ad521ac..f455d70 100644
--- a/chrome/browser/browser_theme_provider_mac.mm
+++ b/chrome/browser/browser_theme_provider_mac.mm
@@ -167,6 +167,42 @@ NSGradient* BrowserThemeProvider::GetNSGradient(int id) const {
// Note that we are not leaking when we assign a retained object to
// |gradient|; in all cases we cache it before we return.
switch (id) {
+ case GRADIENT_FRAME_INCOGNITO:
+ case GRADIENT_FRAME_INCOGNITO_INACTIVE: {
+ // TODO(avi): can we simplify this?
+ BOOL active = id == GRADIENT_FRAME_INCOGNITO;
+ NSColor* base_color = [NSColor colorWithCalibratedRed:83/255.0
+ green:108.0/255.0
+ blue:140/255.0
+ alpha:1.0];
+
+ CGFloat luminance = [base_color gtm_luminance];
+
+ // Adjust luminance so it never hits black.
+ if (luminance < 0.5) {
+ CGFloat adjustment = (0.5 - luminance) / 1.5;
+ base_color = [base_color gtm_colorByAdjustingLuminance:adjustment];
+ }
+
+ NSColor *start_color =
+ [base_color gtm_colorAdjustedFor:GTMColorationBaseMidtone
+ faded:!active];
+ NSColor *end_color =
+ [base_color gtm_colorAdjustedFor:GTMColorationBaseShadow
+ faded:!active];
+
+ if (!active) {
+ start_color = [start_color gtm_colorByAdjustingLuminance:0.1
+ saturation:0.5];
+ end_color = [end_color gtm_colorByAdjustingLuminance:0.1
+ saturation:0.5];
+ }
+
+ gradient = [[NSGradient alloc] initWithStartingColor:start_color
+ endingColor:end_color];
+ break;
+ }
+
case GRADIENT_TOOLBAR:
case GRADIENT_TOOLBAR_INACTIVE: {
NSColor* base_color = [NSColor colorWithCalibratedWhite:0.5 alpha:1.0];