diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:07:19 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:07:19 +0000 |
commit | 04bd2bb5cfa7530ac4caf649310b93d9719c28d3 (patch) | |
tree | 859bf6d1a9fa7bc355fdce592ae87e9b910fea6d | |
parent | 179caa6698de49c762ace7ecc8728d642222f8b9 (diff) | |
download | chromium_src-04bd2bb5cfa7530ac4caf649310b93d9719c28d3.zip chromium_src-04bd2bb5cfa7530ac4caf649310b93d9719c28d3.tar.gz chromium_src-04bd2bb5cfa7530ac4caf649310b93d9719c28d3.tar.bz2 |
Fixes for 10.6
* Workaround for rdar://6857649 - NSGradient fails when using LAB Colorspace
* Update sandbox config file for 10.6
BUG=11265
TEST=Open Chrome on 10.6, it should have tabs and the tab title should reflect
the title of the page that's currently loaded.
Review URL: http://codereview.chromium.org/109032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15328 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/tab_cell.mm | 39 | ||||
-rw-r--r-- | chrome/renderer/renderer.sb | 3 |
2 files changed, 37 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/tab_cell.mm b/chrome/browser/cocoa/tab_cell.mm index 088f848..fcb398b 100644 --- a/chrome/browser/cocoa/tab_cell.mm +++ b/chrome/browser/cocoa/tab_cell.mm @@ -10,6 +10,38 @@ #define CP1_MULTIPLIER 1.0/3.0 #define CP2_MULTIPLIER 3.0/8.0 +namespace { + NSGradient *getGradientForStyle(bool selected, bool active) { + // Workaround for + // rdar://6857649 - NSGradient fails when using LAB Colorspace + // Once that's fixed we can remove this function and just call through + // to -[GTMTheme gradientForStyle:active:] directly with + // GTMThemeStyleTabBarSelected/GTMThemeStyleTabBarDeselected + NSUInteger startHighlight, endHighlight; + if (selected) { + startHighlight = GTMColorationLightHighlight; + endHighlight = GTMColorationLightMidtone; + } else { + startHighlight = GTMColorationBaseShadow; + endHighlight = GTMColorationBaseShadow; + } + + NSColor *backgroundColor = [[GTMTheme defaultTheme] backgroundColor]; + NSColor *startColor = [backgroundColor gtm_colorAdjustedFor:startHighlight + faded:!active]; + NSColor *endColor = [backgroundColor gtm_colorAdjustedFor:endHighlight + faded:!active]; + NSColorSpace *genericRGB = [NSColorSpace genericRGBColorSpace]; + startColor = [startColor colorUsingColorSpace:genericRGB]; + endColor = [endColor colorUsingColorSpace:genericRGB]; + + return [[[NSGradient alloc] initWithStartingColor:startColor + endingColor:endColor] + autorelease]; + + } +} // namespace + @implementation TabCell - (id)initTextCell:(NSString *)aString { @@ -75,12 +107,10 @@ [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)]; [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y + 1)]; - GTMTheme *theme = [GTMTheme defaultTheme]; NSGradient *gradient = nil; if (selected) { - gradient = [theme gradientForStyle:GTMThemeStyleTabBarSelected - active:active]; + gradient = getGradientForStyle(true, active); // Stroke with a translucent black [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.5 : 0.3] set]; [[NSGraphicsContext currentContext] saveGraphicsState]; @@ -90,8 +120,7 @@ [path fill]; [[NSGraphicsContext currentContext] restoreGraphicsState]; } else { - gradient = [theme gradientForStyle:GTMThemeStyleTabBarDeselected - active:active]; + gradient = getGradientForStyle(false, active); // Stroke with a translucent black [[NSColor colorWithCalibratedWhite:0.0 alpha:active ? 0.3 : 0.1] set]; } diff --git a/chrome/renderer/renderer.sb b/chrome/renderer/renderer.sb index 8bb1b3d..4c9dadf 100644 --- a/chrome/renderer/renderer.sb +++ b/chrome/renderer/renderer.sb @@ -19,3 +19,6 @@ (allow mach-lookup (global-name "com.apple.FontObjectsServer")) ; 10.5.6 (allow mach-lookup (global-name "com.apple.FontServer")) ; 10.6 seed release (allow file-read-data (regex #"^/Library/Fonts")) ; 10.6 seed release + +; Needed for IPC on 10.6 +(allow ipc-posix-shm) |