summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/tab_strip.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 22:03:45 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-22 22:03:45 +0000
commit332cacf55c00476da2c75e40510fc748b77519d3 (patch)
treebb8d0e476cc80199bd6782817852f250be0c6ba8 /chrome/browser/views/tabs/tab_strip.cc
parent39d222f7ae7736b0aac15e1fbaeac588613c863e (diff)
downloadchromium_src-332cacf55c00476da2c75e40510fc748b77519d3.zip
chromium_src-332cacf55c00476da2c75e40510fc748b77519d3.tar.gz
chromium_src-332cacf55c00476da2c75e40510fc748b77519d3.tar.bz2
Fixes bug on removing last pinned tab that left new tab button
indented too much. When a tab is removed we don't actually remove the tab until the animation is done. This means the value returned by GetTabHOffset isn't correct until after the tab is removed. I'm fixing by forcing layout when done, which triggers calling GetTabHOffset. The bug exists on both gtk and views, this fixes both. BUG=22934 TEST=see bug Review URL: http://codereview.chromium.org/505071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/tab_strip.cc')
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 82849fa..9c36b43 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -345,6 +345,14 @@ class TabStrip::RemoveTabAnimation : public TabStrip::TabAnimation {
end_pinned_count--;
GenerateStartAndEndWidths(tab_count, tab_count - 1, start_pinned_count,
end_pinned_count);
+ // If the last non-pinned tab is being removed we force a layout on
+ // completion. This is necessary as the value returned by GetTabHOffset
+ // changes once the tab is actually removed (which happens at the end of
+ // the animation), and unless we layout GetTabHOffset won't be called after
+ // the removal.
+ set_layout_on_completion(start_pinned_count > 0 &&
+ start_pinned_count == end_pinned_count &&
+ tab_count == start_pinned_count + 1);
}
// Returns the index of the tab being removed.