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

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

Issue 2473863004: Remove MaterialDesignController::IsModeMaterial (Closed)
Patch Set: pkasting review and rebase Created 4 years, 1 month 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
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 #import "chrome/browser/themes/theme_properties.h" 8 #import "chrome/browser/themes/theme_properties.h"
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
10 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" 10 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
(...skipping 21 matching lines...) Expand all
32 } 32 }
33 33
34 - (id)initWithCoder:(NSCoder*)decoder { 34 - (id)initWithCoder:(NSCoder*)decoder {
35 if ((self = [super initWithCoder:decoder])) { 35 if ((self = [super initWithCoder:decoder])) {
36 hasTip_ = YES; 36 hasTip_ = YES;
37 } 37 }
38 return self; 38 return self;
39 } 39 }
40 40
41 - (void)setInfobarType:(infobars::InfoBarDelegate::Type)infobarType { 41 - (void)setInfobarType:(infobars::InfoBarDelegate::Type)infobarType {
42 SkColor topColor = infobars::InfoBar::GetTopColor(infobarType); 42 // TODO(ellyjones): no need to use a gradient here.
43 SkColor bottomColor = infobars::InfoBar::GetBottomColor(infobarType); 43 SkColor topColor = infobars::InfoBar::GetBackgroundColor(infobarType);
44 SkColor bottomColor = topColor;
44 base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc] 45 base::scoped_nsobject<NSGradient> gradient([[NSGradient alloc]
45 initWithStartingColor:skia::SkColorToCalibratedNSColor(topColor) 46 initWithStartingColor:skia::SkColorToCalibratedNSColor(topColor)
46 endingColor:skia::SkColorToCalibratedNSColor(bottomColor)]); 47 endingColor:skia::SkColorToCalibratedNSColor(bottomColor)]);
47 [self setGradient:gradient]; 48 [self setGradient:gradient];
48 } 49 }
49 50
50 - (NSColor*)strokeColor { 51 - (NSColor*)strokeColor {
51 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; 52 const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
52 if (!themeProvider) 53 if (!themeProvider)
53 return [NSColor blackColor]; 54 return [NSColor blackColor];
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 138 }
138 139
139 - (void)setHasTip:(BOOL)hasTip { 140 - (void)setHasTip:(BOOL)hasTip {
140 if (hasTip_ == hasTip) 141 if (hasTip_ == hasTip)
141 return; 142 return;
142 hasTip_ = hasTip; 143 hasTip_ = hasTip;
143 [self setNeedsDisplay:YES]; 144 [self setNeedsDisplay:YES];
144 } 145 }
145 146
146 @end 147 @end
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service_unittest.cc ('k') | chrome/browser/ui/views/frame/browser_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698