Commit 29cbb720 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Space the new tab button away from the avatar button in maximized mode.

This fix applies solely to pre-refresh and corrects a regression in previous
refactoring I did in https://crrev.com/555249 .

Bug: 840338
Test: Launch chrome in Material (not Refresh) mode; maximized the window and open enough tabs to fill the strip.  The new tab button should not be near-touching the profile avatar button.
Change-Id: I60598a1e7bcf45e039d19424c8639958094b7658
Reviewed-on: https://chromium-review.googlesource.com/1136065
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574833}
parent cd1fee59
......@@ -593,13 +593,15 @@ int GlassBrowserFrameView::TabStripCaptionSpacing() const {
int profile_spacing =
profile_switcher->width() + kProfileSwitcherButtonOffset;
// In non-maximized mode, allow the new tab button to slide completely under
// the profile switcher button.
if (!IsMaximized()) {
const bool incognito = browser_view()->tabstrip()->IsIncognito();
profile_spacing -= GetLayoutSize(NEW_TAB_BUTTON, incognito).width();
}
// In maximized mode, simply treat the profile switcher button as another
// caption button.
if (IsMaximized())
return caption_spacing + profile_spacing;
// When not maximized, allow the new tab button to slide completely under the
// the profile switcher button.
const bool incognito = browser_view()->tabstrip()->IsIncognito();
profile_spacing -= GetLayoutSize(NEW_TAB_BUTTON, incognito).width();
return std::max(caption_spacing, profile_spacing);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment