summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 20:28:52 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 20:28:52 +0000
commitea3a8586a45f7be17935bfdc8ba8a06191f14f5c (patch)
treea363924546224d861548e1386b69536c3c2b222e
parentca13314ef45d4a7ae2db34f4e91f01c2ed176561 (diff)
downloadchromium_src-ea3a8586a45f7be17935bfdc8ba8a06191f14f5c.zip
chromium_src-ea3a8586a45f7be17935bfdc8ba8a06191f14f5c.tar.gz
chromium_src-ea3a8586a45f7be17935bfdc8ba8a06191f14f5c.tar.bz2
Fix placement of new tab button when low on space. Was previously comparing against the wrong minimum values, and the check isn't even necessary.
BUG=18721 TEST=create and close lots of tabs, make sure NTB is placed correctly Review URL: http://codereview.chromium.org/184016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25231 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index ec84d059..2035cdc 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -457,13 +457,13 @@ static const float kUseFullAvailableWidth = -1.0;
[newTabButton_ setHidden:YES];
} else {
NSRect newTabNewFrame = [newTabButton_ frame];
- if ([self inRapidClosureMode])
- newTabNewFrame.origin = NSMakePoint(offset + kNewTabButtonOffset, 0);
- else
- newTabNewFrame.origin =
- NSMakePoint(MIN(availableWidth, offset + kNewTabButtonOffset), 0);
+ // We've already ensured there's enough space for the new tab button
+ // so we don't have to check it against the available width. We do need
+ // to make sure we put it after any placeholder.
+ newTabNewFrame.origin = NSMakePoint(offset, 0);
newTabNewFrame.origin.x = MAX(newTabNewFrame.origin.x,
- NSMaxX(placeholderFrame_));
+ NSMaxX(placeholderFrame_)) +
+ kNewTabButtonOffset;
if ([tabContentsArray_ count])
[newTabButton_ setHidden:NO];