summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 20:09:11 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-22 20:09:11 +0000
commit19cbbd980d6c206782f3c4ea7ed9b1a730a91895 (patch)
treedf82d282811057b5a381bb77799f5fc3fea9819a /chrome/browser
parent1712232b6e2beffa413af6d97cf63b30a3b6e7c7 (diff)
downloadchromium_src-19cbbd980d6c206782f3c4ea7ed9b1a730a91895.zip
chromium_src-19cbbd980d6c206782f3c4ea7ed9b1a730a91895.tar.gz
chromium_src-19cbbd980d6c206782f3c4ea7ed9b1a730a91895.tar.bz2
(1) If you create tabs and manage to resize the window before the
pending layout occurs, you get truncated tabs (As described in issue 6505). Upon resize therefore we reset the reserved width for tabs. (2) When inserting a tab as the second-to-last tab, the size of tabs was incorrect. This lead to shriking tabs in multiple cases (as described in issue 3258). BUG=6505 BUG=3258 Patch contributed by Itai Danan <idanana@google.com> git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 9e99b5d..4bfcf2f 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -672,6 +672,10 @@ void TabStrip::Layout() {
// - animation completion
if (active_animation_.get())
active_animation_->Stop();
+
+ // Reset the reserved tab width on resize in case a layout was left pending.
+ available_width_for_tabs_ = -1;
+
GenerateIdealBounds();
int tab_count = GetTabCount();
int tab_right = 0;
@@ -1472,7 +1476,14 @@ void TabStrip::StartResizeLayoutAnimation() {
void TabStrip::StartInsertTabAnimation(int index) {
// Don't shock users by letting all tabs move when they are focused
// on the tab-strip. Wait for later, when they aren't looking.
- int last_tab_index = GetTabCount() - 2;
+
+ // To compute the required size of the tab-strip we need to get
+ // the last already inserted tab, so if we are inserting the last
+ // one, back off by one.
+ int last_tab_index = GetTabCount() - 1;
+ if (last_tab_index == index)
+ --last_tab_index;
+
if (last_tab_index > 0) {
Tab* last_tab = GetTabAt(last_tab_index);
available_width_for_tabs_ = std::min(