Commit 5cd2d514 authored by sky@chromium.org's avatar sky@chromium.org

Fixes bug where closing a pinned tab followed by dragging a tab could

result in some weird resizing in the tab strip.

BUG=85380
TEST=see bug
R=ben@chromium.org

Review URL: http://codereview.chromium.org/7044061

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88435 0039d316-1c4b-4281-b951-d872f2087c98
parent d19a6fe8
......@@ -214,8 +214,14 @@ void TabStrip::PrepareForCloseAt(int model_index) {
// available_width_for_tabs_ so that if we do a layout we don't position a
// tab past the end of the second to last tab. We do this so that as the
// user closes tabs with the mouse a tab continues to fall under the mouse.
available_width_for_tabs_ = GetAvailableWidthForTabs(
GetTabAtModelIndex(model_count - 2));
Tab* last_tab = GetTabAtModelIndex(model_count - 1);
Tab* tab_being_removed = GetTabAtModelIndex(model_index);
available_width_for_tabs_ = last_tab->x() + last_tab->width() -
tab_being_removed->width() - kTabHOffset;
if (model_index == 0 && tab_being_removed->data().mini &&
!GetTabAtModelIndex(1)->data().mini) {
available_width_for_tabs_ -= mini_to_non_mini_gap_;
}
}
in_tab_close_ = true;
......@@ -996,10 +1002,6 @@ int TabStrip::GetMiniTabCount() const {
return mini_count;
}
int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
return last_tab->x() + last_tab->width();
}
bool TabStrip::IsPointInTab(Tab* tab,
const gfx::Point& point_in_tabstrip_coords) {
gfx::Point point_in_tab_coords(point_in_tabstrip_coords);
......
......@@ -214,9 +214,6 @@ class TabStrip : public BaseTabStrip,
virtual void StartMiniTabAnimation();
void StartMouseInitiatedRemoveTabAnimation(int model_index);
// Calculates the available width for tabs, assuming a Tab is to be closed.
int GetAvailableWidthForTabs(Tab* last_tab) const;
// Returns true if the specified point in TabStrip coords is within the
// hit-test region of the specified Tab.
bool IsPointInTab(Tab* tab, const gfx::Point& point_in_tabstrip_coords);
......
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