blob: 350ea6884220cf97fa507d610482f76b326d3444 [file] [log] [blame]
[email protected]3c645372011-01-25 20:54:061// Copyright (c) 2011 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#import "chrome/browser/fullscreen.h"
6
[email protected]3c645372011-01-25 20:54:067#import <Cocoa/Cocoa.h>
8
[email protected]ee6a5272013-07-15 21:14:019#include "base/command_line.h"
[email protected]ee6a5272013-07-15 21:14:0110
Evan Stade714657b2017-11-01 21:50:4611bool IsFullScreenMode() {
[email protected]d621e702013-01-24 01:43:0012 NSApplicationPresentationOptions options =
13 [NSApp currentSystemPresentationOptions];
14
15 bool dock_hidden = (options & NSApplicationPresentationHideDock) ||
16 (options & NSApplicationPresentationAutoHideDock);
17
18 bool menu_hidden = (options & NSApplicationPresentationHideMenuBar) ||
19 (options & NSApplicationPresentationAutoHideMenuBar);
20
21 // If both dock and menu bar are hidden, that is the equivalent of the Carbon
22 // SystemUIMode (or Info.plist's LSUIPresentationMode) kUIModeAllHidden.
23 if (dock_hidden && menu_hidden)
24 return true;
25
26 if (options & NSApplicationPresentationFullScreen)
27 return true;
28
29 return false;
[email protected]3c645372011-01-25 20:54:0630}