fullscreen_mac.mm 974 B

123456789101112131415161718192021222324252627282930
  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. #import "chrome/browser/fullscreen.h"
  5. #import <Cocoa/Cocoa.h>
  6. #include "base/command_line.h"
  7. bool IsFullScreenMode() {
  8. NSApplicationPresentationOptions options =
  9. [NSApp currentSystemPresentationOptions];
  10. bool dock_hidden = (options & NSApplicationPresentationHideDock) ||
  11. (options & NSApplicationPresentationAutoHideDock);
  12. bool menu_hidden = (options & NSApplicationPresentationHideMenuBar) ||
  13. (options & NSApplicationPresentationAutoHideMenuBar);
  14. // If both dock and menu bar are hidden, that is the equivalent of the Carbon
  15. // SystemUIMode (or Info.plist's LSUIPresentationMode) kUIModeAllHidden.
  16. if (dock_hidden && menu_hidden)
  17. return true;
  18. if (options & NSApplicationPresentationFullScreen)
  19. return true;
  20. return false;
  21. }