| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #import "chrome/browser/fullscreen.h" | 5 #import "chrome/browser/fullscreen.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 | 10 |
| 11 bool IsFullScreenMode() { | 11 bool IsFullScreenMode() { |
| 12 // Check if the main display has been captured (by games in particular). | |
| 13 if (CGDisplayIsCaptured(CGMainDisplayID())) | |
| 14 return true; | |
| 15 | |
| 16 NSApplicationPresentationOptions options = | 12 NSApplicationPresentationOptions options = |
| 17 [NSApp currentSystemPresentationOptions]; | 13 [NSApp currentSystemPresentationOptions]; |
| 18 | 14 |
| 19 bool dock_hidden = (options & NSApplicationPresentationHideDock) || | 15 bool dock_hidden = (options & NSApplicationPresentationHideDock) || |
| 20 (options & NSApplicationPresentationAutoHideDock); | 16 (options & NSApplicationPresentationAutoHideDock); |
| 21 | 17 |
| 22 bool menu_hidden = (options & NSApplicationPresentationHideMenuBar) || | 18 bool menu_hidden = (options & NSApplicationPresentationHideMenuBar) || |
| 23 (options & NSApplicationPresentationAutoHideMenuBar); | 19 (options & NSApplicationPresentationAutoHideMenuBar); |
| 24 | 20 |
| 25 // If both dock and menu bar are hidden, that is the equivalent of the Carbon | 21 // If both dock and menu bar are hidden, that is the equivalent of the Carbon |
| 26 // SystemUIMode (or Info.plist's LSUIPresentationMode) kUIModeAllHidden. | 22 // SystemUIMode (or Info.plist's LSUIPresentationMode) kUIModeAllHidden. |
| 27 if (dock_hidden && menu_hidden) | 23 if (dock_hidden && menu_hidden) |
| 28 return true; | 24 return true; |
| 29 | 25 |
| 30 if (options & NSApplicationPresentationFullScreen) | 26 if (options & NSApplicationPresentationFullScreen) |
| 31 return true; | 27 return true; |
| 32 | 28 |
| 33 return false; | 29 return false; |
| 34 } | 30 } |
| OLD | NEW |