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

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

Issue 603243002: Mac: Fix tab strip relayout bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from rsesek. Created 6 years, 3 months 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/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 89bab85429536e56626929eda2e90a580e00be0b..7b961a8632accb5f8ff6f3fa4fd51be6cfb5e81d 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -191,6 +191,7 @@ willPositionSheet:(NSWindow*)sheet
CGFloat tabStripHeight = NSHeight([tabStripView frame]);
maxY -= tabStripHeight;
NSRect tabStripFrame = NSMakeRect(0, maxY, width, tabStripHeight);
+ BOOL requiresRelayout = !NSEqualRects(tabStripFrame, [tabStripView frame]);
// In Yosemite fullscreen, manually add the fullscreen controls to the tab
// strip.
@@ -201,7 +202,10 @@ willPositionSheet:(NSWindow*)sheet
CGFloat leftIndent = 0;
if (!fullscreen || addControlsInFullscreen)
leftIndent = [[tabStripController_ class] defaultLeftIndentForControls];
- [tabStripController_ setLeftIndentForControls:leftIndent];
+ if (leftIndent != [tabStripController_ leftIndentForControls]) {
+ [tabStripController_ setLeftIndentForControls:leftIndent];
+ requiresRelayout = YES;
+ }
if (addControlsInFullscreen)
[tabStripController_ addWindowControls];
@@ -258,14 +262,18 @@ willPositionSheet:(NSWindow*)sheet
} else if ([self shouldShowAvatar]) {
rightIndent += NSWidth([avatarButton frame]) + kAvatarRightOffset;
}
- [tabStripController_ setRightIndentForControls:rightIndent];
+
+ if (rightIndent != [tabStripController_ rightIndentForControls]) {
+ [tabStripController_ setRightIndentForControls:rightIndent];
+ requiresRelayout = YES;
+ }
// It is undesirable to force tabs relayout when the tap strip's frame did
// not change, because it will interrupt tab animations in progress.
// In addition, there appears to be an AppKit bug on <10.9 where interrupting
// a tab animation resulted in the tab frame being the animator's target
// frame instead of the interrupting setFrame. (See http://crbug.com/415093)
- if (!NSEqualRects(tabStripFrame, [tabStripView frame])){
+ if (requiresRelayout) {
[tabStripView setFrame:tabStripFrame];
[tabStripController_ layoutTabsWithoutAnimation];
}
« 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