summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_strip_controller.h1
-rw-r--r--chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm14
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h
index 5ee59d7..9b90daf 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.h
@@ -76,6 +76,7 @@ class NotificationBridge;
scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server drags
NewTabButton* newTabButton_; // weak, obtained from the nib.
ProfileMenuButton* profileMenuButton_; // weak, obtained from the nib.
+ BOOL hasUpdatedProfileMenuButtonXOffset_;
// Tracks the newTabButton_ for rollovers.
scoped_nsobject<CrTrackingArea> newTabTrackingArea_;
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index fd7ad45..c568e8c 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -1038,6 +1038,20 @@ class NotificationBridge : public NotificationObserver {
NSRect profileMenuButtonFrame = [profileMenuButton_ frame];
NSSize minSize = [profileMenuButton_ minControlSize];
+ // Make room for the full screen button if necessary.
+ if (!hasUpdatedProfileMenuButtonXOffset_) {
+ hasUpdatedProfileMenuButtonXOffset_ = YES;
+ if ([[profileMenuButton_ window]
+ respondsToSelector:@selector(toggleFullScreen:)]) {
+ NSButton* fullscreenButton = [[profileMenuButton_ window]
+ standardWindowButton:NSWindowFullScreenButton];
+ if (fullscreenButton) {
+ profileMenuButtonFrame.origin.x = NSMinX([fullscreenButton frame]) -
+ NSWidth(profileMenuButtonFrame) - kProfileMenuButtonOffset;
+ }
+ }
+ }
+
// TODO(sail): Animate this.
CGFloat availableWidth = NSMaxX(profileMenuButtonFrame) - maxX -
kProfileMenuButtonOffset;