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

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

Issue 10823130: [Mac] Position the avatar and fullscreen buttons when adding the first profile. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 8 years, 5 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 | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
index 91dbff2743c0b16b22cdebf8291ee0a0d59ba11e..cd988a4410ace892349195066419a56b472cb915 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller.mm
@@ -40,6 +40,12 @@
- (void)addOrRemoveButtonIfNecessary;
@end
+// Declare a 10.7+ private API.
+// NSThemeFrame < NSTitledFrame < NSFrameView < NSView.
+@interface NSView (NSThemeFrame)
+- (void)_tileTitlebarAndRedisplay:(BOOL)redisplay;
+@end
+
namespace AvatarButtonControllerInternal {
class Observer : public content::NotificationObserver {
@@ -288,6 +294,15 @@ const CGFloat kMenuYOffsetAdjust = 1.0;
[self.view setHidden:count < 2];
[static_cast<BrowserWindowController*>(wc) layoutSubviews];
+
+ // If the avatar is being added or removed, then the Lion fullscreen button
+ // needs to be adjusted. Since the fullscreen button is positioned by
+ // FramedBrowserWindow using private APIs, the easiest way to update the
+ // position of the button is through this private API. Resizing the window
+ // also works, but invoking |-display| does not.
+ NSView* themeFrame = [[[wc window] contentView] superview];
+ if ([themeFrame respondsToSelector:@selector(_tileTitlebarAndRedisplay:)])
+ [themeFrame _tileTitlebarAndRedisplay:YES];
}
// Testing /////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698