Commit 77265c6e authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Fix Refresh tab icon layout when the tab is small.

Refresh changes the amount of extra padding added to the left of the
favicon. But when the tab is too small to accommodate this extra
padding, Refresh was failing to remove this padding and calculate
icon visibility correctly.

This also fixes TabTest.LayoutAndVisibilityOfElements when Refresh is
enabled.

Bug: 846410, 822061
Change-Id: I2b77b976d55e314da3e6b5193403eb2a102dd426
Reviewed-on: https://chromium-review.googlesource.com/1098148Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567098}
parent 47ef1c5d
......@@ -560,11 +560,11 @@ void Tab::Layout() {
UpdateIconVisibility();
int extra_padding = 0;
if (MD::IsRefreshUi())
extra_padding = kRefreshExtraLeftFavIconPadding;
else if (extra_padding_before_content_)
extra_padding = kExtraLeftPaddingToBalanceCloseButtonPadding;
if (extra_padding_before_content_) {
extra_padding = MD::IsRefreshUi()
? kRefreshExtraLeftFavIconPadding
: kExtraLeftPaddingToBalanceCloseButtonPadding;
}
const int start = contents_rect.x() + extra_padding;
......@@ -1384,7 +1384,9 @@ void Tab::UpdateIconVisibility() {
(is_touch_optimized ? close_button_->GetInsets().right()
: close_button_->GetInsets().width());
int extra_padding = kExtraLeftPaddingToBalanceCloseButtonPadding;
int extra_padding = MD::IsRefreshUi()
? kRefreshExtraLeftFavIconPadding
: kExtraLeftPaddingToBalanceCloseButtonPadding;
const bool is_pinned = data().pinned;
const bool is_active = IsActive();
......
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