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

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

Issue 2403853002: cocoa browser: remove remaining non-MD code (Closed)
Patch Set: git cl format Created 4 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return [NSColor blackColor]; 53 return [NSColor blackColor];
54 54
55 BOOL active = [[self window] isMainWindow]; 55 BOOL active = [[self window] isMainWindow];
56 return themeProvider->GetNSColor( 56 return themeProvider->GetNSColor(
57 active ? ThemeProperties::COLOR_TOOLBAR_STROKE : 57 active ? ThemeProperties::COLOR_TOOLBAR_STROKE :
58 ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE); 58 ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
59 } 59 }
60 60
61 - (void)drawRect:(NSRect)rect { 61 - (void)drawRect:(NSRect)rect {
62 NSRect bounds = [self bounds]; 62 NSRect bounds = [self bounds];
63 if (ui::MaterialDesignController::IsModeMaterial()) { 63 bounds.size.height = InfoBarContainerDelegate::kDefaultBarTargetHeightMd;
64 bounds.size.height = InfoBarContainerDelegate::kDefaultBarTargetHeightMd;
65 } else {
66 bounds.size.height = InfoBarContainerDelegate::kDefaultBarTargetHeight;
67 }
68 CGFloat tipXOffset = arrowX_ - arrowHalfWidth_; 64 CGFloat tipXOffset = arrowX_ - arrowHalfWidth_;
69 65
70 // Around the bounds of the infobar, continue drawing the path into which the 66 // Around the bounds of the infobar, continue drawing the path into which the
71 // gradient will be drawn. 67 // gradient will be drawn.
72 NSBezierPath* infoBarPath = [NSBezierPath bezierPath]; 68 NSBezierPath* infoBarPath = [NSBezierPath bezierPath];
73 [infoBarPath moveToPoint:NSMakePoint(NSMinX(bounds), NSMaxY(bounds))]; 69 [infoBarPath moveToPoint:NSMakePoint(NSMinX(bounds), NSMaxY(bounds))];
74 70
75 // Draw the tip. 71 // Draw the tip.
76 if (hasTip_) { 72 if (hasTip_) {
77 [infoBarPath lineToPoint:NSMakePoint(tipXOffset, NSMaxY(bounds))]; 73 [infoBarPath lineToPoint:NSMakePoint(tipXOffset, NSMaxY(bounds))];
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 137 }
142 138
143 - (void)setHasTip:(BOOL)hasTip { 139 - (void)setHasTip:(BOOL)hasTip {
144 if (hasTip_ == hasTip) 140 if (hasTip_ == hasTip)
145 return; 141 return;
146 hasTip_ = hasTip; 142 hasTip_ = hasTip;
147 [self setNeedsDisplay:YES]; 143 [self setNeedsDisplay:YES];
148 } 144 }
149 145
150 @end 146 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/infobar_controller.mm ('k') | chrome/browser/ui/cocoa/menu_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698