| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 if (![[NSScreen class] | 528 if (![[NSScreen class] |
| 529 respondsToSelector:@selector(screensHaveSeparateSpaces)]) | 529 respondsToSelector:@selector(screensHaveSeparateSpaces)]) |
| 530 return [self isWindowOnPrimaryScreen]; | 530 return [self isWindowOnPrimaryScreen]; |
| 531 | 531 |
| 532 BOOL eachScreenShouldHaveMenuBar = [NSScreen screensHaveSeparateSpaces]; | 532 BOOL eachScreenShouldHaveMenuBar = [NSScreen screensHaveSeparateSpaces]; |
| 533 return eachScreenShouldHaveMenuBar ?: [self isWindowOnPrimaryScreen]; | 533 return eachScreenShouldHaveMenuBar ?: [self isWindowOnPrimaryScreen]; |
| 534 } | 534 } |
| 535 | 535 |
| 536 - (BOOL)isWindowOnPrimaryScreen { | 536 - (BOOL)isWindowOnPrimaryScreen { |
| 537 NSScreen* screen = [[browserController_ window] screen]; | 537 NSScreen* screen = [[browserController_ window] screen]; |
| 538 NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; | 538 NSScreen* primaryScreen = [[NSScreen screens] firstObject]; |
| 539 return (screen == primaryScreen); | 539 return (screen == primaryScreen); |
| 540 } | 540 } |
| 541 | 541 |
| 542 - (base::mac::FullScreenMode)desiredSystemFullscreenMode { | 542 - (base::mac::FullScreenMode)desiredSystemFullscreenMode { |
| 543 if ([self shouldShowMenubarInImmersiveFullscreen]) | 543 if ([self shouldShowMenubarInImmersiveFullscreen]) |
| 544 return base::mac::kFullScreenModeHideDock; | 544 return base::mac::kFullScreenModeHideDock; |
| 545 return base::mac::kFullScreenModeHideAll; | 545 return base::mac::kFullScreenModeHideAll; |
| 546 } | 546 } |
| 547 | 547 |
| 548 - (void)changeOverlayToFraction:(CGFloat)fraction | 548 - (void)changeOverlayToFraction:(CGFloat)fraction |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 [self updateMenuBarAndDockVisibility]; | 746 [self updateMenuBarAndDockVisibility]; |
| 747 | 747 |
| 748 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 748 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
| 749 } | 749 } |
| 750 | 750 |
| 751 - (BOOL)shouldShowMenubarInImmersiveFullscreen { | 751 - (BOOL)shouldShowMenubarInImmersiveFullscreen { |
| 752 return [self doesScreenHaveMenuBar] && toolbarFraction_ > 0.99; | 752 return [self doesScreenHaveMenuBar] && toolbarFraction_ > 0.99; |
| 753 } | 753 } |
| 754 | 754 |
| 755 @end | 755 @end |
| OLD | NEW |