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

Unified Diff: chrome/browser/cocoa/infobar_gradient_view.mm

Issue 2831004: Managed preferences warning banner for Mac preferences dialog (Closed)
Patch Set: rebase, take care of comments. Created 10 years, 6 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
« no previous file with comments | « chrome/browser/cocoa/infobar_gradient_view.h ('k') | chrome/browser/cocoa/preferences_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « chrome/browser/cocoa/infobar_gradient_view.h ('k') | chrome/browser/cocoa/preferences_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698