diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 19:27:28 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-03 19:27:28 +0000 |
commit | ce04f0c9b299f5afbc6a44839f302baabe498cd1 (patch) | |
tree | 83b7b5fb2b88a95930d7a2d9360b7b2427567bb7 /base/mac_util.h | |
parent | ea2cad155442906261ce832585a36630c6f10d98 (diff) | |
download | chromium_src-ce04f0c9b299f5afbc6a44839f302baabe498cd1.zip chromium_src-ce04f0c9b299f5afbc6a44839f302baabe498cd1.tar.gz chromium_src-ce04f0c9b299f5afbc6a44839f302baabe498cd1.tar.bz2 |
[Mac] When in fullscreen mode, ties the menubar shown state to the overlay shown state.
BUG=36610
TEST=Go fullscreen. Menubar should only be shown when the overlay is fully visible.
TEST=While in fullscreen mode, fullscreen a youtube video. Menubar should be autohidden (mousing to the top of the screen should show it).
Review URL: http://codereview.chromium.org/661380
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac_util.h')
-rw-r--r-- | base/mac_util.h | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/base/mac_util.h b/base/mac_util.h index 864bc24..4c3f6ba 100644 --- a/base/mac_util.h +++ b/base/mac_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -28,6 +28,19 @@ typedef unsigned int NSSearchPathDirectory; namespace mac_util { +// Full screen modes, in increasing order of priority. More permissive modes +// take predecence. +enum FullScreenMode { + kFullScreenModeHideAll = 0, + kFullScreenModeHideDock = 1, + kFullScreenModeAutoHideAll = 2, + kNumFullScreenModes = 3, + + // kFullScreenModeNormal is not a valid FullScreenMode, but it is useful to + // other classes, so we include it here. + kFullScreenModeNormal = 10, +}; + std::string PathFromFSRef(const FSRef& ref); bool FSRefFromPath(const std::string& path, FSRef* ref); @@ -75,17 +88,24 @@ CGColorSpaceRef GetSRGBColorSpace(); // is a static value; do not release it! CGColorSpaceRef GetSystemColorSpace(); -// Add a request for full screen mode. This does not by itself create a -// fullscreen window; rather, it manages per-application state related to -// fullscreen windows. For example, if the menu bar is not currently -// hidden, this will hide it. Must be called on main thread. -void RequestFullScreen(); - -// Release a request for full screen mode. As with RequestFullScree(), this -// does not affect windows directly, but rather manages per-application state. -// For example, if there are no other outstanding requests for full screen, -// this will show the menu bar. Must be called on main thread. -void ReleaseFullScreen(); +// Add a full screen request for the given |mode|. Must be paired with a +// ReleaseFullScreen() call for the same |mode|. This does not by itself create +// a fullscreen window; rather, it manages per-application state related to +// hiding the dock and menubar. Must be called on the main thread. +void RequestFullScreen(FullScreenMode mode); + +// Release a request for full screen mode. Must be matched with a +// RequestFullScreen() call for the same |mode|. As with RequestFullScreen(), +// this does not affect windows directly, but rather manages per-application +// state. For example, if there are no other outstanding +// |kFullScreenModeAutoHideAll| requests, this will reshow the menu bar. Must +// be called on main thread. +void ReleaseFullScreen(FullScreenMode mode); + +// Convenience method to switch the current fullscreen mode. This has the same +// net effect as a ReleaseFullScreen(from_mode) call followed immediately by a +// RequestFullScreen(to_mode). Must be called on the main thread. +void SwitchFullScreenModes(FullScreenMode from_mode, FullScreenMode to_mode); // Set the visibility of the cursor. void SetCursorVisibility(bool visible); |