| Index: chrome/browser/ui/views/location_bar/location_bar_layout.cc
|
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_layout.cc b/chrome/browser/ui/views/location_bar/location_bar_layout.cc
|
| index d28201821314512c0194701164f07fbcd4dfdd36..c04bf3af637899613f798c9711994f8cd68376c6 100644
|
| --- a/chrome/browser/ui/views/location_bar/location_bar_layout.cc
|
| +++ b/chrome/browser/ui/views/location_bar/location_bar_layout.cc
|
| @@ -128,18 +128,23 @@ void LocationBarLayout::LayoutPass2(int *entry_width) {
|
| }
|
| }
|
|
|
| -void LocationBarLayout::LayoutPass3(gfx::Rect* bounds, int* available_width) {
|
| +void LocationBarLayout::LayoutPass3(gfx::Rect* bounds,
|
| + int* available_width,
|
| + bool allow_collapse) {
|
| bool first_visible = true;
|
| for (const auto& decoration : decorations_) {
|
| // Collapse decorations if needed.
|
| if (decoration->auto_collapse) {
|
| int padding = (first_visible ? decoration->edge_item_padding
|
| : decoration->item_padding);
|
| - // Try preferred size, if it fails try minimum size, if it fails collapse.
|
| + // Try preferred size and if it fails try minimum size.
|
| decoration->computed_width = decoration->view->GetPreferredSize().width();
|
| if (decoration->computed_width + padding > *available_width)
|
| decoration->computed_width = decoration->view->GetMinimumSize().width();
|
| - if (decoration->computed_width + padding > *available_width) {
|
| + // If there's insufficient room for the minimum size of the decoration and
|
| + // we are allowed to collapse, hide the decoration.
|
| + if (allow_collapse &&
|
| + decoration->computed_width + padding > *available_width) {
|
| decoration->computed_width = 0;
|
| decoration->view->SetVisible(false);
|
| } else {
|
|
|