OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/cocoa/presentation_mode_controller.h" | 5 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Stops any running animations, removes tracking areas, etc. | 174 // Stops any running animations, removes tracking areas, etc. |
175 - (void)cleanup; | 175 - (void)cleanup; |
176 | 176 |
177 // Shows and hides the UI associated with this window being active (having main | 177 // Shows and hides the UI associated with this window being active (having main |
178 // status). This includes hiding the menu bar. These functions are called when | 178 // status). This includes hiding the menu bar. These functions are called when |
179 // the window gains or loses main status as well as in |-cleanup|. | 179 // the window gains or loses main status as well as in |-cleanup|. |
180 - (void)showActiveWindowUI; | 180 - (void)showActiveWindowUI; |
181 - (void)hideActiveWindowUI; | 181 - (void)hideActiveWindowUI; |
182 | 182 |
183 // In Immersive Fullscreen, the menubar is visible iff. toolbarFraction_ >= | 183 // Whether the menu bar should be shown in immersive fullscreen for the screen |
184 // 1.0. | 184 // that contains the window. |
185 - (BOOL)shouldShowMenubarInImmersiveFullscreen; | 185 - (BOOL)shouldShowMenubarInImmersiveFullscreen; |
186 | 186 |
187 @end | 187 @end |
188 | 188 |
189 | 189 |
190 @implementation PresentationModeController | 190 @implementation PresentationModeController |
191 | 191 |
192 @synthesize inPresentationMode = inPresentationMode_; | 192 @synthesize inPresentationMode = inPresentationMode_; |
193 @synthesize slidingStyle = slidingStyle_; | 193 @synthesize slidingStyle = slidingStyle_; |
194 @synthesize toolbarFraction = toolbarFraction_; | 194 @synthesize toolbarFraction = toolbarFraction_; |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 // TODO(rohitrao): Insert the Exit Fullscreen button. http://crbug.com/35956 | 738 // TODO(rohitrao): Insert the Exit Fullscreen button. http://crbug.com/35956 |
739 } | 739 } |
740 | 740 |
741 - (void)hideActiveWindowUI { | 741 - (void)hideActiveWindowUI { |
742 [self updateMenuBarAndDockVisibility]; | 742 [self updateMenuBarAndDockVisibility]; |
743 | 743 |
744 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 744 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
745 } | 745 } |
746 | 746 |
747 - (BOOL)shouldShowMenubarInImmersiveFullscreen { | 747 - (BOOL)shouldShowMenubarInImmersiveFullscreen { |
748 return toolbarFraction_ >= 1.0; | 748 return [self doesScreenHaveMenuBar] && toolbarFraction_ > 0.99; |
749 } | 749 } |
750 | 750 |
751 @end | 751 @end |
OLD | NEW |