Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/browser_window_controller.mm (revision 88138) |
+++ chrome/browser/ui/cocoa/browser_window_controller.mm (working copy) |
@@ -157,19 +157,9 @@ |
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
@interface NSWindow (LionSDKDeclarations) |
-- (void)toggleFullScreen:(id)sender; |
- (void)setRestorable:(BOOL)flag; |
@end |
-enum { |
- NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, |
- NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 |
-}; |
- |
-enum { |
- NSWindowFullScreenButton = 7 |
-}; |
- |
#endif // MAC_OS_X_VERSION_10_7 |
// IncognitoImageView subclasses NSView to allow mouse events to pass through it |
@@ -417,21 +407,8 @@ |
if ([self hasToolbar]) // Do not create the buttons in popups. |
[toolbarController_ createBrowserActionButtons]; |
- // For versions of Mac OS that provide an "enter fullscreen" button, make |
- // one appear (in a rather hacky manner). http://crbug.com/74065 : When |
- // switching the fullscreen implementation to the new API, revisit how much |
- // of this hacky code is necessary. |
- if ([window respondsToSelector:@selector(toggleFullScreen:)]) { |
- NSWindowCollectionBehavior behavior = [window collectionBehavior]; |
- behavior |= NSWindowCollectionBehaviorFullScreenPrimary; |
- [window setCollectionBehavior:behavior]; |
+ [self setUpOSFullScreenButton]; |
- NSButton* fullscreenButton = |
- [window standardWindowButton:NSWindowFullScreenButton]; |
- [fullscreenButton setAction:@selector(enterFullscreen:)]; |
- [fullscreenButton setTarget:self]; |
- } |
- |
// We are done initializing now. |
initializing_ = NO; |
} |
@@ -2060,6 +2037,10 @@ |
// We're done moving focus, so re-enable bar visibility changes. |
[self enableBarVisibilityUpdates]; |
+ // This needs to be done when leaving full-screen mode to ensure that the |
+ // button's action is set properly. |
+ [self setUpOSFullScreenButton]; |
+ |
// Fade back in. |
if (didFadeOut) { |
CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendSolidColor, |