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

Unified Diff: chrome/browser/ui/cocoa/tab_strip_controller.mm

Issue 6036005: Mac: trivial clean up of tab strip layout code + unseeable layout fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleaned up cleanup Created 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm
index 876067c640b766e3f34a0755931a56b6f320ca33..826910c88efee9326409cc26b96043df9ad6ac3f 100644
--- a/chrome/browser/ui/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm
@@ -791,7 +791,6 @@ private:
BOOL visible = [[tabStripView_ window] isVisible];
CGFloat offset = [self indentForControls];
- NSUInteger i = 0;
bool hasPlaceholderGap = false;
for (TabController* tab in tabArray_.get()) {
// Ignore a tab that is going through a close animation.
@@ -811,9 +810,8 @@ private:
// If the tab is hidden, we consider it a new tab. We make it visible
// and animate it in.
BOOL newTab = [[tab view] isHidden];
- if (newTab) {
+ if (newTab)
[[tab view] setHidden:NO];
- }
if (isPlaceholder) {
// Move the current tab to the correct location instantly.
@@ -896,7 +894,6 @@ private:
offset += NSWidth(tabFrame);
offset -= kTabOverlap;
}
- i++;
}
// Hide the new tab button if we're explicitly told to. It may already
@@ -909,10 +906,8 @@ private:
// We've already ensured there's enough space for the new tab button
// so we don't have to check it against the available space. 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_)) +
- kNewTabButtonOffset;
+ CGFloat maxTabX = MAX(offset, NSMaxX(placeholderFrame_) - kTabOverlap);
+ newTabNewFrame.origin = NSMakePoint(maxTabX + kNewTabButtonOffset, 0);
if ([tabContentsArray_ count])
[newTabButton_ setHidden:NO];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698