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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.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 | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
===================================================================
--- chrome/browser/ui/cocoa/browser_window_controller_private.mm (revision 88138)
+++ chrome/browser/ui/cocoa/browser_window_controller_private.mm (working copy)
@@ -30,6 +30,26 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
+// Provide the forward-declarations of new 10.7 SDK symbols so they can be
+// called when building with the 10.5 SDK.
+#if !defined(MAC_OS_X_VERSION_10_7) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+@interface NSWindow (LionSDKDeclarations)
+- (void)toggleFullScreen:(id)sender;
+@end
+
+enum {
+ NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
+ NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8
+};
+
+enum {
+ NSWindowFullScreenButton = 7
+};
+
+#endif // MAC_OS_X_VERSION_10_7
+
namespace {
// Space between the incognito badge and the right edge of the window.
@@ -42,23 +62,8 @@
const CGFloat kLocBarTopInset = 0;
const CGFloat kLocBarBottomInset = 1;
-} // end namespace
+} // namespace
-// 10.7 adds public APIs for full-screen support. Provide the declaration so it
-// can be called below when building with the 10.5 SDK.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
-MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSWindow (LionSDKDeclarations)
-- (void)toggleFullScreen:(id)sender;
-@end
-
-enum {
- NSWindowFullScreenButton = 7
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
@implementation BrowserWindowController(Private)
// Create the appropriate tab strip controller based on whether or not side
@@ -538,4 +543,18 @@
[fullscreenController_ cancelAnimationAndTimers];
}
+- (void)setUpOSFullScreenButton {
+ NSWindow* window = [self window];
+ if ([window respondsToSelector:@selector(toggleFullScreen:)]) {
+ NSWindowCollectionBehavior behavior = [window collectionBehavior];
+ behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
+ [window setCollectionBehavior:behavior];
+
+ NSButton* fullscreenButton =
+ [window standardWindowButton:NSWindowFullScreenButton];
+ [fullscreenButton setAction:@selector(enterFullscreen:)];
+ [fullscreenButton setTarget:self];
+ }
+}
+
@end // @implementation BrowserWindowController(Private)
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698