Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chrome/browser/ui/cocoa/presentation_mode_controller.mm

Issue 1380083005: Mac: Use [NSArray firstObject] for [NSScreen screens] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/panels/panel_utils_cocoa.mm ('k') | chrome/browser/ui/window_sizer/window_sizer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698