summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 00:31:04 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 00:31:04 +0000
commitd54e03a5f055dbdbe31b037e934e3feea364e4bc (patch)
tree2491b03537f1152bfaeed05b5da6ab87d4d3cafe /chrome/browser/views/tabs
parentb3471fde838d00d0b640a9d6aff957b5799a9c0d (diff)
downloadchromium_src-d54e03a5f055dbdbe31b037e934e3feea364e4bc.zip
chromium_src-d54e03a5f055dbdbe31b037e934e3feea364e4bc.tar.gz
chromium_src-d54e03a5f055dbdbe31b037e934e3feea364e4bc.tar.bz2
Move search code to a subdir
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 3232ec4..7791289 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -1470,8 +1470,17 @@ void TabStrip::StartResizeLayoutAnimation() {
}
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));