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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/infobar_controller.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 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" 5 #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #import "chrome/browser/ui/cocoa/animatable_view.h" 10 #import "chrome/browser/ui/cocoa/animatable_view.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 labelFrame.size.width += NSMinX(imageFrame) - NSMinX(labelFrame); 66 labelFrame.size.width += NSMinX(imageFrame) - NSMinX(labelFrame);
67 labelFrame.origin.x = imageFrame.origin.x; 67 labelFrame.origin.x = imageFrame.origin.x;
68 [image_ removeFromSuperview]; 68 [image_ removeFromSuperview];
69 image_ = nil; 69 image_ = nil;
70 [labelPlaceholder_ setFrame:labelFrame]; 70 [labelPlaceholder_ setFrame:labelFrame];
71 } 71 }
72 [self initializeLabel]; 72 [self initializeLabel];
73 73
74 [self addAdditionalControls]; 74 [self addAdditionalControls];
75 75
76 // With Material Design infobars are drawn a little taller, so have to move 76 // Infobars are drawn a little taller, so have to move its controls to keep
77 // its controls to keep them centered. 77 // them centered.
78 if (ui::MaterialDesignController::IsModeMaterial()) { 78 CGFloat heightDelta = InfoBarContainerDelegate::kDefaultBarTargetHeightMd -
79 CGFloat heightDelta = InfoBarContainerDelegate::kDefaultBarTargetHeightMd - 79 InfoBarContainerDelegate::kDefaultBarTargetHeight;
80 InfoBarContainerDelegate::kDefaultBarTargetHeight; 80 for (NSView* nextSubview in [infoBarView_ subviews]) {
81 for (NSView* nextSubview in [infoBarView_ subviews]) { 81 NSRect frame = [nextSubview frame];
82 NSRect frame = [nextSubview frame]; 82 frame.origin.y += heightDelta / 2;
83 frame.origin.y += heightDelta / 2; 83 [nextSubview setFrame:frame];
84 [nextSubview setFrame:frame];
85 }
86 } 84 }
87 85
88 [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()]; 86 [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()];
89 [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; 87 [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
90 } 88 }
91 89
92 - (void)dealloc { 90 - (void)dealloc {
93 [okButton_ setTarget:nil]; 91 [okButton_ setTarget:nil];
94 [cancelButton_ setTarget:nil]; 92 [cancelButton_ setTarget:nil];
95 [closeButton_ setTarget:nil]; 93 [closeButton_ setTarget:nil];
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]]; 193 [newLabel setAutoresizingMask:[labelPlaceholder_ autoresizingMask]];
196 [[labelPlaceholder_ superview] 194 [[labelPlaceholder_ superview]
197 replaceSubview:labelPlaceholder_ with:newLabel]; 195 replaceSubview:labelPlaceholder_ with:newLabel];
198 labelPlaceholder_ = nil; // Now released. 196 labelPlaceholder_ = nil; // Now released.
199 [newLabel setDelegate:self]; 197 [newLabel setDelegate:self];
200 198
201 label_.reset(newLabel.release()); 199 label_.reset(newLabel.release());
202 } 200 }
203 201
204 @end 202 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/hover_close_button.mm ('k') | chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698