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

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

Issue 7003036: Fix OS full-screen button on FutureCat (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698