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

Unified Diff: chrome/browser/ui/cocoa/infobars/infobar_controller.mm

Issue 1885903003: [Mac] Increase infobar height under Material Design. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698