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

Side by Side Diff: chrome/browser/cocoa/vertical_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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/cocoa/vertical_gradient_view.h"
6
7 @implementation VerticalGradientView
8
9 - (NSGradient*)gradient {
10 return gradient_;
11 }
12
13 - (void)setGradient:(NSGradient*)gradient {
14 gradient_.reset([gradient retain]);
15 }
16
17 - (NSColor*)strokeColor {
18 return strokeColor_;
19 }
20
21 - (void)setStrokeColor:(NSColor*)strokeColor {
22 strokeColor_.reset([strokeColor retain]);
23 }
24
25 - (void)drawRect:(NSRect)rect {
26 // Draw gradient.
27 [[self gradient] drawInRect:[self bounds] angle:270];
28
29 // Draw bottom stroke.
30 NSColor* strokeColor = [self strokeColor];
31 if (strokeColor) {
32 [[self strokeColor] set];
33 NSRect borderRect, contentRect;
34 NSDivideRect([self bounds], &borderRect, &contentRect, 1, NSMinYEdge);
35 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
36 }
37 }
38
39 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/vertical_gradient_view.h ('k') | chrome/browser/cocoa/vertical_gradient_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698