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 @@
#ifndef 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>
// A custom view that draws the background gradient for an infobar.
@interface InfoBarBackgroundView : VerticalGradientView
// Sets the infobar background color.
- (void)setInfobarBackgroundColor:(SkColor)color;
// A custom view that draws the background for an infobar.
@interface InfoBarBackgroundView : NSView
@end
......
......@@ -26,14 +26,6 @@
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 {
const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
if (!themeProvider)
......@@ -41,24 +33,17 @@
BOOL active = [[self window] isMainWindow];
return themeProvider->GetNSColor(
active ? ThemeProperties::COLOR_TOOLBAR_STROKE :
ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
active ? ThemeProperties::COLOR_TOOLBAR_STROKE
: ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
}
- (void)drawRect:(NSRect)rect {
NSRect bounds = [self bounds];
// Around the bounds of the infobar, continue drawing the path into which the
// gradient will be drawn.
NSBezierPath* infoBarPath = [NSBezierPath bezierPath];
[infoBarPath moveToPoint:NSMakePoint(NSMinX(bounds), NSMaxY(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];
// Draw the background.
// TODO(ellyjones): Use the detached bookmark bar color here.
[[NSColor whiteColor] set];
NSRectFill([self bounds]);
NSColor* strokeColor = [self strokeColor];
if (strokeColor) {
......@@ -69,14 +54,6 @@
NSDivideRect(bounds, &borderRect, &contentRect, 1, NSMinYEdge);
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 {
......
......@@ -81,7 +81,6 @@
[nextSubview setFrame:frame];
}
[infoBarView_ setInfobarBackgroundColor:SK_ColorWHITE];
[infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
cocoa_l10n_util::FlipAllSubviewsIfNecessary(
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