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

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

Issue 567713002: Mac: Fix profile button overlaps fullscreen button on new windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 45ec95fdb3a36e2556468c858dbac700ba39201a..c8b048a05bc2aaca8d4dd91cba853064f6dbd07d 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -374,21 +374,31 @@ using content::WebContents;
// Allow bar visibility to be changed.
[self enableBarVisibilityUpdates];
- // Force a relayout of all the various bars.
- [self layoutSubviews];
-
// Set the window to participate in Lion Fullscreen mode. Setting this flag
// has no effect on Snow Leopard or earlier. Panels can share a fullscreen
// space with a tabbed window, but they can not be primary fullscreen
- // windows. Do this after |-layoutSubviews| so that the fullscreen button
- // can be adjusted in FramedBrowserWindow.
+ // windows.
NSUInteger collectionBehavior = [window collectionBehavior];
collectionBehavior |=
browser_->type() == Browser::TYPE_TABBED ||
browser_->type() == Browser::TYPE_POPUP ?
NSWindowCollectionBehaviorFullScreenPrimary :
NSWindowCollectionBehaviorFullScreenAuxiliary;
- [window setCollectionBehavior:collectionBehavior];
+
+ if ([self shouldUseNewAvatarButton]) {
+ // The new avatar button is to the left of the fullscreen button.
+ // We need to call layoutSubviews after the fullscreen button is enabled
+ // because the avatar button's position depends on it.
+ [window setCollectionBehavior:collectionBehavior];
+ [self layoutSubviews];
+ } else {
+ // The old avatar button is to the right of the fullscreen button.
+ // We need to call layoutSubviews first because the fullscreen button's
+ // position depends on it.
+ // See -[FramedBrowserWindow fullScreenButtonOriginAdjustment].
+ [self layoutSubviews];
+ [window setCollectionBehavior:collectionBehavior];
+ }
// For a popup window, |desiredContentRect| contains the desired height of
// the content, not of the whole window. Now that all the views are laid
« 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