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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h" 5 #include "chrome/browser/ui/cocoa/infobars/infobar_gradient_view.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/infobars/infobar.h" 8 #include "chrome/browser/infobars/infobar.h"
9 #import "chrome/browser/themes/theme_properties.h" 9 #import "chrome/browser/themes/theme_properties.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 - (id)initWithCoder:(NSCoder*)decoder { 31 - (id)initWithCoder:(NSCoder*)decoder {
32 if ((self = [super initWithCoder:decoder])) { 32 if ((self = [super initWithCoder:decoder])) {
33 hasTip_ = YES; 33 hasTip_ = YES;
34 } 34 }
35 return self; 35 return self;
36 } 36 }
37 37
38 - (void)setInfobarType:(InfoBarDelegate::Type)infobarType { 38 - (void)setInfobarType:(InfoBarDelegate::Type)infobarType {
39 SkColor topColor = GetInfoBarTopColor(infobarType); 39 SkColor topColor = InfoBar::GetTopColor(infobarType);
40 SkColor bottomColor = GetInfoBarBottomColor(infobarType); 40 SkColor bottomColor = InfoBar::GetBottomColor(infobarType);
41 base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc] 41 base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc]
42 initWithStartingColor:gfx::SkColorToCalibratedNSColor(topColor) 42 initWithStartingColor:gfx::SkColorToCalibratedNSColor(topColor)
43 endingColor:gfx::SkColorToCalibratedNSColor(bottomColor)]); 43 endingColor:gfx::SkColorToCalibratedNSColor(bottomColor)]);
44 [self setGradient:gradient]; 44 [self setGradient:gradient];
45 } 45 }
46 46
47 - (NSColor*)strokeColor { 47 - (NSColor*)strokeColor {
48 ui::ThemeProvider* themeProvider = [[self window] themeProvider]; 48 ui::ThemeProvider* themeProvider = [[self window] themeProvider];
49 if (!themeProvider) 49 if (!themeProvider)
50 return [NSColor blackColor]; 50 return [NSColor blackColor];
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 - (void)setHasTip:(BOOL)hasTip { 137 - (void)setHasTip:(BOOL)hasTip {
138 if (hasTip_ == hasTip) 138 if (hasTip_ == hasTip)
139 return; 139 return;
140 hasTip_ = hasTip; 140 hasTip_ = hasTip;
141 [self setNeedsDisplay:YES]; 141 [self setNeedsDisplay:YES];
142 } 142 }
143 143
144 @end 144 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698