summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:09:27 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 22:09:27 +0000
commite4852829e1f5f872ac622d1c698c0f31458fce6e (patch)
treec6333cafb7812935041418d2fb0780746ba33236
parenteb0bff94e83fb3d6829cc9fe01468fdce672e7c3 (diff)
downloadchromium_src-e4852829e1f5f872ac622d1c698c0f31458fce6e.zip
chromium_src-e4852829e1f5f872ac622d1c698c0f31458fce6e.tar.gz
chromium_src-e4852829e1f5f872ac622d1c698c0f31458fce6e.tar.bz2
Move profile menu button to leave room for full screen button
With this change we now move the profile menu button to the left if a full screen button exists. Here's a screenshot of what this looks like: https://docs.google.com/leaf?id=0B0Odde3V7EhWMmEzOGFhYzktOWE1Ny00NjU2LWE2NDYtZTcwMTRhNmUzMjRi&hl=en when collapsed: https://docs.google.com/leaf?id=0B0Odde3V7EhWOGUxMDlmYzgtZjEyMi00NjdiLTg1YTUtNDE3MmZjZDdhMTFm&hl=en BUG=None TEST=Ran and verified that the profile menu button didn't overlap the fullscreen button. Review URL: http://codereview.chromium.org/6802026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80849 0039d316-1c4b-4281-b951-d872f2087c98
-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;