summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 11:39:02 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 11:39:02 +0000
commit6c4a32d6bde80481b35b246b7fd5ba1e47e21c4e (patch)
tree14c40da057c89e54956b7af1564c2172af4cc8e2 /base
parenta169d5ddee589c92bfb59e2ee85da87fd9c25f93 (diff)
downloadchromium_src-6c4a32d6bde80481b35b246b7fd5ba1e47e21c4e.zip
chromium_src-6c4a32d6bde80481b35b246b7fd5ba1e47e21c4e.tar.gz
chromium_src-6c4a32d6bde80481b35b246b7fd5ba1e47e21c4e.tar.bz2
Work around bug coming back from hiding menu bar with fullscreen.
BUG=170189,225659 TEST=as in bug 225659 Review URL: https://chromiumcodereview.appspot.com/13583005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/mac/mac_util.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 35c1949..48b4e5a 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -27,6 +27,16 @@
namespace base {
namespace mac {
+// Replicate specific 10.7 SDK declarations for building with prior SDKs.
+#if !defined(MAC_OS_X_VERSION_10_7) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+enum {
+ NSApplicationPresentationFullScreen = 1 << 10
+};
+
+#endif // MAC_OS_X_VERSION_10_7
+
namespace {
// The current count of outstanding requests for full screen mode from browser
@@ -60,6 +70,17 @@ void SetUIMode() {
NSApplicationPresentationHideMenuBar;
}
+ // Bug-fix: if the window is fullscreened (Lion-style) and
+ // NSApplicationPresentationDefault is requested, the result is that the menu
+ // bar doesn't auto-hide. In that case, explicitly set the presentation
+ // options to the ones that are set by the system as it fullscreens a window.
+ if (desired_options == NSApplicationPresentationDefault &&
+ current_options & NSApplicationPresentationFullScreen) {
+ desired_options |= NSApplicationPresentationFullScreen |
+ NSApplicationPresentationAutoHideMenuBar |
+ NSApplicationPresentationAutoHideDock;
+ }
+
if (current_options != desired_options)
[NSApp setPresentationOptions:desired_options];
}