| Index: chrome/browser/cocoa/infobar_gradient_view.mm
|
| diff --git a/chrome/browser/cocoa/infobar_gradient_view.mm b/chrome/browser/cocoa/infobar_gradient_view.mm
|
| index 6af8fbb1989ae2615bb0b36de634a3be142978e5..1dc0b7cf6c92f69bc238a144e5ac2b756df2546b 100644
|
| --- a/chrome/browser/cocoa/infobar_gradient_view.mm
|
| +++ b/chrome/browser/cocoa/infobar_gradient_view.mm
|
| @@ -4,13 +4,17 @@
|
|
|
| #include "chrome/browser/cocoa/infobar_gradient_view.h"
|
|
|
| +#include "base/scoped_nsobject.h"
|
| #import "chrome/browser/browser_theme_provider.h"
|
| #import "chrome/browser/cocoa/themed_window.h"
|
|
|
| +namespace {
|
| +
|
| const double kBackgroundColorTop[3] =
|
| {255.0 / 255.0, 242.0 / 255.0, 183.0 / 255.0};
|
| const double kBackgroundColorBottom[3] =
|
| {250.0 / 255.0, 230.0 / 255.0, 145.0 / 255.0};
|
| +}
|
|
|
| @implementation InfoBarGradientView
|
|
|
| @@ -26,24 +30,14 @@ const double kBackgroundColorBottom[3] =
|
| green:kBackgroundColorBottom[1]
|
| blue:kBackgroundColorBottom[2]
|
| alpha:1.0];
|
| - gradient_ =
|
| + scoped_nsobject<NSGradient> gradient(
|
| [[NSGradient alloc] initWithStartingColor:startingColor
|
| - endingColor:endingColor];
|
| + endingColor:endingColor]);
|
| + [self setGradient:gradient];
|
| }
|
| return self;
|
| }
|
|
|
| -- (void)dealloc {
|
| - [gradient_ release];
|
| - [super dealloc];
|
| -}
|
| -
|
| -- (void)setGradient:(NSGradient*)gradient {
|
| - [gradient retain];
|
| - [gradient_ release];
|
| - gradient_ = gradient;
|
| -}
|
| -
|
| - (NSColor*)strokeColor {
|
| ThemeProvider* themeProvider = [[self window] themeProvider];
|
| if (!themeProvider)
|
| @@ -56,16 +50,6 @@ const double kBackgroundColorBottom[3] =
|
| true);
|
| }
|
|
|
| -- (void)drawRect:(NSRect)rect {
|
| - [gradient_ drawInRect:[self bounds] angle:270];
|
| -
|
| - // Draw bottom stroke
|
| - [[self strokeColor] set];
|
| - NSRect borderRect, contentRect;
|
| - NSDivideRect([self bounds], &borderRect, &contentRect, 1, NSMinYEdge);
|
| - NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
|
| -}
|
| -
|
| - (BOOL)mouseDownCanMoveWindow {
|
| return NO;
|
| }
|
|
|