Chromium Code Reviews| Index: base/mac/mac_util.mm |
| diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm |
| index 35c1949fa095c58dcd7ef552dad12c0feca51695..48b4e5a190a240cfb0ec115c27cf7d4a76cf7445 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. |
|
Nico
2013/04/03 22:16:07
file rdar
|
| + if (desired_options == NSApplicationPresentationDefault && |
| + current_options & NSApplicationPresentationFullScreen) { |
| + desired_options |= NSApplicationPresentationFullScreen | |
| + NSApplicationPresentationAutoHideMenuBar | |
| + NSApplicationPresentationAutoHideDock; |
| + } |
| + |
| if (current_options != desired_options) |
| [NSApp setPresentationOptions:desired_options]; |
| } |