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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 1876293002: [Mac][Material Design] Center elements within the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extension_button_rework
Patch Set: Create constant for location bar padding. 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
index 31b1b2f493cd95f858a43b1abef22d41181bb92f..1e0b74e89e99ad7d7e95a7b3ad42987ef949c401 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm
@@ -81,6 +81,10 @@ const NSTimeInterval kToolBarAnimationDuration = 0.12;
// The height of the location bar in Material Design.
const CGFloat kMaterialDesignLocationBarHeight = 28;
+// The padding between the top of the toolbar and the top of the
+// location bar.
+const CGFloat kMaterialDesignLocationBarPadding = 2;
+
// The padding between Material Design elements and the edges of the toolbar.
const CGFloat kMaterialDesignElementPadding = 4;
@@ -308,8 +312,7 @@ class NotificationBridge : public AppMenuBadgeController::Delegate {
backButtonFrame.origin.x =
kMaterialDesignElementPadding + kMaterialDesignButtonInset;
backButtonFrame.origin.y = NSMaxY(toolbarBounds) -
- kMaterialDesignElementPadding - kMaterialDesignButtonInset -
- toolbarButtonSize.height;
+ kMaterialDesignElementPadding - toolbarButtonSize.height;
backButtonFrame.size = toolbarButtonSize;
[backButton_ setFrame:backButtonFrame];
@@ -361,7 +364,7 @@ class NotificationBridge : public AppMenuBadgeController::Delegate {
locationBarFrame.origin.x = NSMaxX(homeButtonFrame) +
kMaterialDesignButtonInset;
locationBarFrame.origin.y = NSMaxY(toolbarBounds) -
- kMaterialDesignElementPadding - kMaterialDesignLocationBarHeight;
+ kMaterialDesignLocationBarPadding - kMaterialDesignLocationBarHeight;
locationBarFrame.size.width =
menuButtonFrame.origin.x -
locationBarFrame.origin.x;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698