Chromium Code Reviews| Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| index 180b01ee29af2a0583ad8a64f53d82744ffe638f..1f4347f385ab2a3acee9a96b3998cec1a3394035 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| @@ -199,9 +199,7 @@ gfx::Size ToolbarActionsBar::GetPreferredSize() const { |
| } |
| int ToolbarActionsBar::GetMinimumWidth() const { |
| - if (!platform_settings_.chevron_enabled || toolbar_actions_.empty()) |
| - return platform_settings_.item_spacing; |
| - return 2 * platform_settings_.item_spacing + delegate_->GetChevronWidth(); |
| + return platform_settings_.item_spacing; |
| } |
| int ToolbarActionsBar::GetMaximumWidth() const { |
| @@ -211,18 +209,14 @@ int ToolbarActionsBar::GetMaximumWidth() const { |
| int ToolbarActionsBar::IconCountToWidth(int icons) const { |
| if (icons < 0) |
| icons = toolbar_actions_.size(); |
| - const bool display_chevron = |
| - platform_settings_.chevron_enabled && |
| - static_cast<size_t>(icons) < toolbar_actions_.size(); |
| - if (icons == 0 && !display_chevron) |
| + if (icons == 0) |
| return platform_settings_.item_spacing; |
| - const int icons_size = (icons == 0) ? 0 : |
| + const int icons_size = |
| (icons * IconWidth(true)) - platform_settings_.item_spacing; |
|
Evan Stade
2016/05/24 17:58:55
nit: i think most of this fn can be rewritten as
Devlin
2016/05/24 21:59:00
Done.
|
| - const int chevron_size = display_chevron ? delegate_->GetChevronWidth() : 0; |
| const int side_padding = platform_settings_.item_spacing * 2; |
| - return icons_size + chevron_size + side_padding; |
| + return icons_size + side_padding; |
| } |
| size_t ToolbarActionsBar::WidthToIconCount(int pixels) const { |
| @@ -230,11 +224,8 @@ size_t ToolbarActionsBar::WidthToIconCount(int pixels) const { |
| if (pixels >= IconCountToWidth(-1)) |
| return toolbar_actions_.size(); |
| - // We reserve space for the padding on either side of the toolbar and, |
| - // if enabled, for the chevron. |
| + // We reserve space for the padding on either side of the toolbar. |
| int available_space = pixels - (platform_settings_.item_spacing * 2); |
| - if (platform_settings_.chevron_enabled) |
| - available_space -= delegate_->GetChevronWidth(); |
| // Now we add an extra between-item padding value so the space can be divided |
| // evenly by (size of icon with padding). |
| @@ -711,7 +702,6 @@ void ToolbarActionsBar::OnToolbarActionRemoved(const std::string& action_id) { |
| // removed an entry directly from the overflow list). |
| delegate_->Redraw(false); |
| } else { |
| - delegate_->SetChevronVisibility(false); |
| // Either we went from overflow to no-overflow, or we shrunk the no- |
| // overflow container by 1. Either way the size changed, so animate. |
| ResizeDelegate(gfx::Tween::EASE_OUT, false); |
| @@ -745,7 +735,7 @@ void ToolbarActionsBar::ResizeDelegate(gfx::Tween::Type tween_type, |
| int desired_width = GetPreferredSize().width(); |
| if (desired_width != |
| delegate_->GetWidth(ToolbarActionsBarDelegate::GET_WIDTH_CURRENT)) { |
| - delegate_->ResizeAndAnimate(tween_type, desired_width, suppress_chevron); |
| + delegate_->ResizeAndAnimate(tween_type, desired_width); |
| } else if (delegate_->IsAnimating()) { |
| // It's possible that we're right where we're supposed to be in terms of |
| // width, but that we're also currently resizing. If this is the case, end |