1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_ 6 #define UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_ 7 8 #import <Cocoa/Cocoa.h> 9 10 #include "base/mac/mac_util.h" 11 #include "base/mac/scoped_nsobject.h" 12 #include "ui/base/ui_export.h" 13 14 // A utility class to manage the fullscreen mode for a given window. This class 15 // also updates the window frame if the screen changes. 16 UI_EXPORT 17 @interface FullscreenWindowManager : NSObject { 18 @private 19 base::scoped_nsobject<NSWindow> window_; 20 // Explicitly keep track of the screen we want to position the window in. 21 // This is better than using -[NSWindow screen] because that might change if 22 // the screen changes to a low resolution. 23 base::scoped_nsobject<NSScreen> desiredScreen_; 24 base::mac::FullScreenMode fullscreenMode_; 25 BOOL fullscreenActive_; 26 } 27 28 - (id)initWithWindow:(NSWindow*)window 29 desiredScreen:(NSScreen*)desiredScreen; 30 31 // Enables fullscreen mode which causes the menubar and dock to be hidden as 32 // needed. 33 - (void)enterFullscreenMode; 34 35 // Exists fullscreen mode which stops hiding the menubar and dock. 36 - (void)exitFullscreenMode; 37 38 @end 39 40 #endif // UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_ 41