| Index: chrome/browser/ui/views/toolbar/toolbar_view.cc
|
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
| index 5f1b2a608f0a7b92ac4182509a32659576a85043..21dea04eabd9baad1baa53a9309ca6aa13a61adb 100644
|
| --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
| +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
| @@ -604,21 +604,30 @@ void ToolbarView::Layout() {
|
| theme_provider->GetDisplayProperty(
|
| ThemeProperties::PROPERTY_TOOLBAR_VIEW_STANDARD_SPACING);
|
|
|
| - int browser_actions_width = browser_actions_->GetPreferredSize().width();
|
| + int browser_actions_desired_width =
|
| + browser_actions_->GetPreferredSize().width();
|
| int app_menu_width = app_menu_->GetPreferredSize().width();
|
| const int right_edge_spacing = theme_provider->GetDisplayProperty(
|
| ThemeProperties::PROPERTY_TOOLBAR_VIEW_RIGHT_EDGE_SPACING);
|
| const int location_bar_right_padding = theme_provider->GetDisplayProperty(
|
| ThemeProperties::PROPERTY_TOOLBAR_VIEW_LOCATION_BAR_RIGHT_PADDING);
|
| +
|
| + // Don't allow the omnibox to shrink to the point of non-existence.
|
| + int kMinimumLocationBarWidth = 100;
|
| int available_width = std::max(
|
| - 0, width() - right_edge_spacing - app_menu_width - browser_actions_width -
|
| - (browser_actions_width > 0 ? element_padding : 0) -
|
| - location_bar_right_padding - next_element_x);
|
| + 0, width() - right_edge_spacing - app_menu_width -
|
| + (browser_actions_desired_width > 0 ? element_padding : 0) -
|
| + location_bar_right_padding - next_element_x -
|
| + kMinimumLocationBarWidth);
|
| + int browser_actions_width =
|
| + std::min(available_width, browser_actions_desired_width);
|
| + available_width -= browser_actions_width;
|
| + int location_bar_width = kMinimumLocationBarWidth + available_width;
|
|
|
| int location_height = location_bar_->GetPreferredSize().height();
|
| int location_y = (height() - location_height + 1) / 2;
|
| location_bar_->SetBounds(next_element_x, location_y,
|
| - std::max(available_width, 0), location_height);
|
| + location_bar_width, location_height);
|
| next_element_x = location_bar_->bounds().right() + location_bar_right_padding;
|
|
|
| browser_actions_->SetBounds(
|
|
|