diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 03:38:58 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 03:38:58 +0000 |
commit | 26103c1a53d4db0e87879af3e7ceece412f33f3e (patch) | |
tree | 26c33b44984727d880e8cf3e572ba8803404115e /chrome | |
parent | 1545917e8c1170a109aeb5f4616b2f2e73e729ce (diff) | |
download | chromium_src-26103c1a53d4db0e87879af3e7ceece412f33f3e.zip chromium_src-26103c1a53d4db0e87879af3e7ceece412f33f3e.tar.gz chromium_src-26103c1a53d4db0e87879af3e7ceece412f33f3e.tar.bz2 |
Restore r25049 (back out r25295) to isolate it as the cause of bug 20872.
TBR=pinkerton
BUG=20872
TEST=watch perf
Review URL: http://codereview.chromium.org/194008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 69eae6d..2035cdc 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -419,8 +419,10 @@ static const float kUseFullAvailableWidth = -1.0; tabFrame.origin.x = offset; } - // Animate the tab in by putting it below the horizon. - if (newTab && visible && animate) { + // Animate the tab in by putting it below the horizon, but don't bother + // if we only have 1 tab. + BOOL shouldAnimate = animate && [tabContentsArray_ count] > 1; + if (newTab && visible && shouldAnimate) { [[tab view] setFrame:NSOffsetRect(tabFrame, 0, -NSHeight(tabFrame))]; } @@ -449,7 +451,8 @@ static const float kUseFullAvailableWidth = -1.0; } // Hide the new tab button if we're explicitly told to. It may already - // be hidden, doing it again doesn't hurt. + // be hidden, doing it again doesn't hurt. Otherwise position it + // appropriately, showing it if necessary. if (forceNewTabButtonHidden_) { [newTabButton_ setHidden:YES]; } else { @@ -461,10 +464,8 @@ static const float kUseFullAvailableWidth = -1.0; newTabNewFrame.origin.x = MAX(newTabNewFrame.origin.x, NSMaxX(placeholderFrame_)) + kNewTabButtonOffset; - if (i > 0 && [newTabButton_ isHidden]) { - id target = animate ? [newTabButton_ animator] : newTabButton_; - [target setHidden:NO]; - } + if ([tabContentsArray_ count]) + [newTabButton_ setHidden:NO]; if (!NSEqualRects(newTabTargetFrame_, newTabNewFrame)) { [newTabButton_ setFrame:newTabNewFrame]; |