[email protected] | 3c64537 | 2011-01-25 20:54:06 | [diff] [blame] | 1 | // 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] | 3c64537 | 2011-01-25 20:54:06 | [diff] [blame] | 7 | #import <Cocoa/Cocoa.h> |
| 8 | |
[email protected] | ee6a527 | 2013-07-15 21:14:01 | [diff] [blame] | 9 | #include "base/command_line.h" |
[email protected] | ee6a527 | 2013-07-15 21:14:01 | [diff] [blame] | 10 | |
Evan Stade | 714657b | 2017-11-01 21:50:46 | [diff] [blame] | 11 | bool IsFullScreenMode() { |
[email protected] | d621e70 | 2013-01-24 01:43:00 | [diff] [blame] | 12 | 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] | 3c64537 | 2011-01-25 20:54:06 | [diff] [blame] | 30 | } |