Chromium Code Reviews| Index: chrome/browser/ui/cocoa/infobars/infobar_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm |
| index 24d2cd4c3ad128ad37242cd130b434223bd4ba4a..7703da721bd3bc6f9156b87c8a4dd32b8fef8ea9 100644 |
| --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm |
| +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm |
| @@ -20,6 +20,7 @@ |
| #include "grit/theme_resources.h" |
| #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
| #include "ui/base/l10n/l10n_util_mac.h" |
| +#include "ui/base/material_design/material_design_controller.h" |
| #include "ui/gfx/image/image.h" |
| #include "ui/resources/grit/ui_resources.h" |
| @@ -72,6 +73,18 @@ |
| [self addAdditionalControls]; |
| + // With Material Design infobars are drawn a little taller, so have to move |
| + // its controls to keep them centered. |
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
| + CGFloat heightDelta = InfoBarContainerDelegate::kDefaultBarTargetHeightMd - |
| + InfoBarContainerDelegate::kDefaultBarTargetHeight; |
| + for (NSView* nextSubview in [infoBarView_ subviews]) { |
| + NSRect frame = [nextSubview frame]; |
| + frame.origin.y += heightDelta / 2; |
| + [nextSubview setFrame:frame]; |
| + } |
| + } |
|
Avi (use Gerrit)
2016/04/13 21:35:00
Joy...
It's a race now between the switch to MD a
|
| + |
| [infoBarView_ setInfobarType:[self delegate]->GetInfoBarType()]; |
| [infoBarView_ setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; |
| } |