Commit e8b35e25 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Return unclamped width for BrowserActionsContainer

This method is used from ToolbarActionsBar to see if
BrowserActionsContainer is larger than all visible actions (and needs
to be downsized).

Per a recent change this was clamping to the ToolbarActionsBar max size
which would make ToolbarActionsBar think it's already the appropriate
full size and not not animate it to the smaller new full size.

Bug: chromium:831977
Change-Id: I1a8b3a83504a4f0afcf6e72146bef0e85ecc4fd9
Reviewed-on: https://chromium-review.googlesource.com/1011343Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550504}
parent 1a301a4e
......@@ -245,17 +245,15 @@ void BrowserActionsContainer::ResizeAndAnimate(gfx::Tween::Type tween_type,
}
int BrowserActionsContainer::GetWidth(GetWidthTime get_width_time) const {
// This call originates from ToolbarActionsBar which wants to know how much
// space is / will be used for action icons (excluding the separator).
const int width_without_separator =
(get_width_time == GET_WIDTH_AFTER_ANIMATION && animation_target_size_ > 0
? animation_target_size_
: width()) -
GetSeparatorAreaWidth();
// This clamps to the toolbar actions bar "internal" min/max widths which does
// not include the separator area. These minimum / maximum widths are separate
// from BrowserActionsContainers' bounds.
return base::ClampToRange(width_without_separator,
toolbar_actions_bar_->GetMinimumWidth(),
toolbar_actions_bar_->GetMaximumWidth());
return std::max(0, width_without_separator);
}
bool BrowserActionsContainer::IsAnimating() const {
......
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