summaryrefslogtreecommitdiffstats
path: root/ui/base/cocoa/fullscreen_window_manager.h
blob: b09493bead0b4ab7b0593d72d67b7e5b248238b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_
#define UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_

#import <Cocoa/Cocoa.h>

#include "base/mac/mac_util.h"
#include "base/memory/scoped_nsobject.h"

// A utility class to manage the fullscreen mode for a given window. This class
// also updates the window frame if the screen changes.
@interface FullscreenWindowManager : NSObject {
 @private
  scoped_nsobject<NSWindow> window_;
  // Explicitly keep track of the screen we want to position the window in.
  // This is better than using -[NSWindow screen] because that might change if
  // the screen changes to a low resolution.
  scoped_nsobject<NSScreen> desiredScreen_;
  base::mac::FullScreenMode fullscreenMode_;
  BOOL fullscreenActive_;
}

- (id)initWithWindow:(NSWindow*)window
       desiredScreen:(NSScreen*)desiredScreen;

// Enables fullscreen mode which causes the menubar and dock to be hidden as
// needed.
- (void)enterFullscreenMode;

// Exists fullscreen mode which stops hiding the menubar and dock.
- (void)exitFullscreenMode;

@end

#endif  // UI_BASE_COCOA_FULLSCREEN_WINDOW_MANAGER_H_