Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1396)

Unified Diff: chrome/browser/views/tabs/tab_strip.cc

Issue 14050: Fix for Issue 3258: Tabs created when tabstrip is compressed pending resize r... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_strip.cc
===================================================================
--- chrome/browser/views/tabs/tab_strip.cc (revision 6886)
+++ chrome/browser/views/tabs/tab_strip.cc (working copy)
@@ -1470,8 +1470,17 @@
}
void TabStrip::StartInsertTabAnimation(int index) {
- // The TabStrip can now use its entire width to lay out Tabs.
- available_width_for_tabs_ = -1;
+ // 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;
+ if (last_tab_index > 0) {
+ Tab* last_tab = GetTabAt(last_tab_index);
+ available_width_for_tabs_ = std::min(
+ GetAvailableWidthForTabs(last_tab) + last_tab->width(),
+ width() - (kNewTabButtonHOffset + newtab_button_size_.width()));
+ } else {
+ available_width_for_tabs_ = -1;
+ }
if (active_animation_.get())
active_animation_->Stop();
active_animation_.reset(new InsertTabAnimation(this, index));
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698