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