Chromium Code Reviews| Index: chrome/browser/ui/views/tabs/tab_strip.cc |
| diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc |
| index 1303b262410f73ae1ef9986eb74151b4aec637f8..6620532bd0439b0bf8c661d31739683ee183aece 100644 |
| --- a/chrome/browser/ui/views/tabs/tab_strip.cc |
| +++ b/chrome/browser/ui/views/tabs/tab_strip.cc |
| @@ -252,8 +252,9 @@ TabDragController::EventSource EventSourceFromEvent( |
| const TabSizeInfo& GetTabSizeInfo() { |
| static TabSizeInfo* tab_size_info = nullptr; |
| - if (tab_size_info) |
| - return *tab_size_info; |
| + |
| +// if (tab_size_info) |
| +// return *tab_size_info; |
|
tdanderson
2016/05/02 18:55:44
Turns out the source of the incorrect drawing was
|
| tab_size_info = new TabSizeInfo; |
| tab_size_info->pinned_tab_width = Tab::GetPinnedWidth(); |
| @@ -1712,8 +1713,7 @@ void TabStrip::Init() { |
| // So we get enter/exit on children to switch stacked layout on and off. |
| set_notify_enter_exit_on_child(true); |
| - newtab_button_bounds_.set_size(GetLayoutSize(NEW_TAB_BUTTON)); |
| - newtab_button_bounds_.Inset(0, 0, 0, -GetNewTabButtonTopOffset()); |
| + CalculateNewTabButtonSize(); |
| newtab_button_ = new NewTabButton(this, this); |
| newtab_button_->SetTooltipText( |
| l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB)); |
| @@ -2508,6 +2508,7 @@ void TabStrip::GenerateIdealBounds() { |
| tabs_.set_ideal_bounds(i, tabs_bounds[i]); |
| } |
| + CalculateNewTabButtonSize(); |
|
tdanderson
2016/05/02 18:55:44
Same problem: the new tab button dimensions are ca
|
| const int max_new_tab_x = width() - newtab_button_bounds_.width(); |
| // For non-stacked tabs the ideal bounds may go outside the bounds of the |
| // tabstrip. Constrain the x-coordinate of the new tab button so that it is |
| @@ -2521,6 +2522,11 @@ void TabStrip::GenerateIdealBounds() { |
| FOR_EACH_OBSERVER(TabStripObserver, observers_, TabStripMaxXChanged(this)); |
| } |
| +void TabStrip::CalculateNewTabButtonSize() { |
| + newtab_button_bounds_.set_size(GetLayoutSize(NEW_TAB_BUTTON)); |
| + newtab_button_bounds_.Inset(0, 0, 0, -GetNewTabButtonTopOffset()); |
| +} |
| + |
| int TabStrip::GenerateIdealBoundsForPinnedTabs(int* first_non_pinned_index) { |
| const int num_pinned_tabs = GetPinnedTabCount(); |