Commit 1d26eda6 authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Fix getting BrowserActionsContainer target width when animating

The target width can be set to zero when the action bar has no
icons. Zero in this case is a valid target width that should be
used instead of the current width when animating.

BUG=831560

Change-Id: Ib6604a9c56a6b922025cd3d3bce2773f78d3eda4
Reviewed-on: https://chromium-review.googlesource.com/1008871
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550658}
parent f45666be
......@@ -247,12 +247,11 @@ 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
const int target_width =
get_width_time == GET_WIDTH_AFTER_ANIMATION && animating()
? animation_target_size_
: width()) -
GetSeparatorAreaWidth();
: width();
const int width_without_separator = target_width - GetSeparatorAreaWidth();
return std::max(0, width_without_separator);
}
......
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