Index: chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm |
diff --git a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm |
index bc866b095deeccbecd3d05e0c013b2ae97202287..2cbab4d3c8bea0a8cfabad431d9feeca43804b55 100644 |
--- a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm |
+++ b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm |
@@ -194,7 +194,6 @@ static NSEvent* MakeMouseEvent(NSEventType type, |
// Update layout of controls in the titlebar. |
[self updateCloseButtonLayout]; |
- [self updateIconAndTitleLayout]; |
// Set autoresizing behavior: glued to edges on left, top and right. |
[self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)]; |
@@ -204,8 +203,11 @@ static NSEvent* MakeMouseEvent(NSEventType type, |
selector:@selector(didChangeTheme:) |
name:kBrowserThemeDidChangeNotification |
object:nil]; |
- // Register for various window focus changes, so we can update our custom |
- // titlebar appropriately. |
+ [[NSNotificationCenter defaultCenter] |
+ addObserver:self |
+ selector:@selector(didChangeFrame:) |
+ name:NSViewFrameDidChangeNotification |
+ object:self]; |
[[NSNotificationCenter defaultCenter] |
addObserver:self |
selector:@selector(didChangeMainWindow:) |
@@ -300,6 +302,10 @@ static NSEvent* MakeMouseEvent(NSEventType type, |
[[closeButton_ cell] setHighlighted:NO]; |
} |
+- (void)didChangeFrame:(NSNotification*)notification { |
+ [self updateIconAndTitleLayout]; |
+} |
+ |
- (void)didChangeTheme:(NSNotification*)notification { |
[self setNeedsDisplay:YES]; |
} |
@@ -411,6 +417,10 @@ static NSEvent* MakeMouseEvent(NSEventType type, |
return controller_; |
} |
+- (NSTextField*)title { |
+ return title_; |
+} |
+ |
- (void)simulateCloseButtonClick { |
[[closeButton_ cell] performClick:closeButton_]; |
} |