Commit f8d4376e authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove remnants of gradient drawing from Mac infobars.

BUG=none
TEST=none

Change-Id: I0c4a1c28077e0b19b3e2be8f0448eef5e58c8909
Reviewed-on: https://chromium-review.googlesource.com/996771
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548865}
parent 95807795
...@@ -5,16 +5,10 @@ ...@@ -5,16 +5,10 @@
#ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_BACKGROUND_VIEW_H_ #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_BACKGROUND_VIEW_H_
#define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_BACKGROUND_VIEW_H_ #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_BACKGROUND_VIEW_H_
#import "chrome/browser/ui/cocoa/vertical_gradient_view.h"
#include "third_party/skia/include/core/SkColor.h"
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
// A custom view that draws the background gradient for an infobar. // A custom view that draws the background for an infobar.
@interface InfoBarBackgroundView : VerticalGradientView @interface InfoBarBackgroundView : NSView
// Sets the infobar background color.
- (void)setInfobarBackgroundColor:(SkColor)color;
@end @end
......
...@@ -26,14 +26,6 @@ ...@@ -26,14 +26,6 @@
return self; return self;
} }
- (void)setInfobarBackgroundColor:(SkColor)color {
// TODO(ellyjones): no need to use a gradient here.
base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc]
initWithStartingColor:skia::SkColorToCalibratedNSColor(color)
endingColor:skia::SkColorToCalibratedNSColor(color)]);
[self setGradient:gradient];
}
- (NSColor*)strokeColor { - (NSColor*)strokeColor {
const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider) if (!themeProvider)
...@@ -41,24 +33,17 @@ ...@@ -41,24 +33,17 @@
BOOL active = [[self window] isMainWindow]; BOOL active = [[self window] isMainWindow];
return themeProvider->GetNSColor( return themeProvider->GetNSColor(
active ? ThemeProperties::COLOR_TOOLBAR_STROKE : active ? ThemeProperties::COLOR_TOOLBAR_STROKE
ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE); : ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
} }
- (void)drawRect:(NSRect)rect { - (void)drawRect:(NSRect)rect {
NSRect bounds = [self bounds]; NSRect bounds = [self bounds];
// Around the bounds of the infobar, continue drawing the path into which the // Draw the background.
// gradient will be drawn. // TODO(ellyjones): Use the detached bookmark bar color here.
NSBezierPath* infoBarPath = [NSBezierPath bezierPath]; [[NSColor whiteColor] set];
[infoBarPath moveToPoint:NSMakePoint(NSMinX(bounds), NSMaxY(bounds))]; NSRectFill([self bounds]);
[infoBarPath lineToPoint:NSMakePoint(NSMaxX(bounds), NSMaxY(bounds))];
[infoBarPath lineToPoint:NSMakePoint(NSMaxX(bounds), NSMinY(bounds))];
[infoBarPath lineToPoint:NSMakePoint(NSMinX(bounds), NSMinY(bounds))];
[infoBarPath closePath];
// Draw the gradient.
[[self gradient] drawInBezierPath:infoBarPath angle:270];
NSColor* strokeColor = [self strokeColor]; NSColor* strokeColor = [self strokeColor];
if (strokeColor) { if (strokeColor) {
...@@ -69,14 +54,6 @@ ...@@ -69,14 +54,6 @@
NSDivideRect(bounds, &borderRect, &contentRect, 1, NSMinYEdge); NSDivideRect(bounds, &borderRect, &contentRect, 1, NSMinYEdge);
NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
} }
// Add an inner stroke.
NSBezierPath* highlightPath = [NSBezierPath bezierPath];
[highlightPath moveToPoint:NSMakePoint(NSMinX(bounds), NSMaxY(bounds) - 1)];
[highlightPath lineToPoint:NSMakePoint(NSMaxX(bounds), NSMaxY(bounds) - 1)];
[[NSColor colorWithDeviceWhite:1.0 alpha:1.0] setStroke];
[highlightPath stroke];
} }
- (BOOL)mouseDownCanMoveWindow { - (BOOL)mouseDownCanMoveWindow {
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
[nextSubview setFrame:frame]; [nextSubview setFrame:frame];
} }
[infoBarView_ setInfobarBackgroundColor:SK_ColorWHITE];
[infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
cocoa_l10n_util::FlipAllSubviewsIfNecessary( cocoa_l10n_util::FlipAllSubviewsIfNecessary(
base::mac::ObjCCast<NSView>(infoBarView_)); base::mac::ObjCCast<NSView>(infoBarView_));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment