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

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

Issue 607603003: Mac: Minor fullscreen adjustments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix presentation mode unit test. Created 6 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/browser_window_controller_private.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 if (FramedBrowserWindow* framedBrowserWindow = 824 if (FramedBrowserWindow* framedBrowserWindow =
825 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { 825 base::mac::ObjCCast<FramedBrowserWindow>([self window])) {
826 [framedBrowserWindow toggleSystemFullScreen]; 826 [framedBrowserWindow toggleSystemFullScreen];
827 } 827 }
828 } 828 }
829 829
830 - (void)updateLayoutParameters:(BrowserWindowLayout*)layout { 830 - (void)updateLayoutParameters:(BrowserWindowLayout*)layout {
831 [layout setContentViewSize:[[[self window] contentView] bounds].size]; 831 [layout setContentViewSize:[[[self window] contentView] bounds].size];
832 [layout setWindowSize:[[self window] frame].size]; 832 [layout setWindowSize:[[self window] frame].size];
833 833
834 [layout setInAnyFullscreen:[self isInFullscreenWithOmniboxSliding]]; 834 [layout setInAnyFullscreen:[self isInAnyFullscreenMode]];
835 [layout setFullscreenSlidingStyle: 835 [layout setFullscreenSlidingStyle:
836 presentationModeController_.get().slidingStyle]; 836 presentationModeController_.get().slidingStyle];
837 [layout setFullscreenMenubarOffset: 837 [layout setFullscreenMenubarOffset:
838 [presentationModeController_ menubarOffset]]; 838 [presentationModeController_ menubarOffset]];
839 [layout setFullscreenToolbarFraction: 839 [layout setFullscreenToolbarFraction:
840 [presentationModeController_ toolbarFraction]]; 840 [presentationModeController_ toolbarFraction]];
841 841
842 [layout setHasTabStrip:[self hasTabStrip]]; 842 [layout setHasTabStrip:[self hasTabStrip]];
843 843
844 [layout setHasToolbar:[self hasToolbar]]; 844 [layout setHasToolbar:[self hasToolbar]];
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 [findBarCocoaController_ 904 [findBarCocoaController_
905 positionFindBarViewAtMaxY:output.findBarMaxY 905 positionFindBarViewAtMaxY:output.findBarMaxY
906 maxWidth:NSWidth(output.contentAreaFrame)]; 906 maxWidth:NSWidth(output.contentAreaFrame)];
907 907
908 [fullscreenExitBubbleController_ 908 [fullscreenExitBubbleController_
909 positionInWindowAtTop:output.fullscreenExitButtonMaxY 909 positionInWindowAtTop:output.fullscreenExitButtonMaxY
910 width:NSWidth(output.contentAreaFrame)]; 910 width:NSWidth(output.contentAreaFrame)];
911 } 911 }
912 912
913 - (void)updateSubviewZOrder { 913 - (void)updateSubviewZOrder {
914 if ([self isInFullscreenWithOmniboxSliding]) 914 if ([self isInAnyFullscreenMode])
915 [self updateSubviewZOrderFullscreen]; 915 [self updateSubviewZOrderFullscreen];
916 else 916 else
917 [self updateSubviewZOrderNormal]; 917 [self updateSubviewZOrderNormal];
918 918
919 [self updateSubviewZOrderHack]; 919 [self updateSubviewZOrderHack];
920 } 920 }
921 921
922 - (void)updateSubviewZOrderNormal { 922 - (void)updateSubviewZOrderNormal {
923 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); 923 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]);
924 if ([downloadShelfController_ view]) 924 if ([downloadShelfController_ view])
925 [subviews addObject:[downloadShelfController_ view]]; 925 [subviews addObject:[downloadShelfController_ view]];
926 if ([bookmarkBarController_ view]) 926 if ([bookmarkBarController_ view])
927 [subviews addObject:[bookmarkBarController_ view]]; 927 [subviews addObject:[bookmarkBarController_ view]];
928 if ([toolbarController_ view]) 928 if ([toolbarController_ view])
929 [subviews addObject:[toolbarController_ view]]; 929 [subviews addObject:[toolbarController_ view]];
930 if ([infoBarContainerController_ view]) 930 if ([infoBarContainerController_ view])
931 [subviews addObject:[infoBarContainerController_ view]]; 931 [subviews addObject:[infoBarContainerController_ view]];
932 if ([self tabContentArea]) 932 if ([self tabContentArea])
933 [subviews addObject:[self tabContentArea]]; 933 [subviews addObject:[self tabContentArea]];
934 if ([findBarCocoaController_ view]) 934 if ([findBarCocoaController_ view])
935 [subviews addObject:[findBarCocoaController_ view]]; 935 [subviews addObject:[findBarCocoaController_ view]];
936 936
937 [self setContentViewSubviews:subviews]; 937 [self setContentViewSubviews:subviews];
938 } 938 }
939 939
940 - (void)updateSubviewZOrderFullscreen { 940 - (void)updateSubviewZOrderFullscreen {
941 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); 941 base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]);
942 if ([downloadShelfController_ view]) 942 if ([downloadShelfController_ view])
943 [subviews addObject:[downloadShelfController_ view]]; 943 [subviews addObject:[downloadShelfController_ view]];
944 if ([infoBarContainerController_ view])
945 [subviews addObject:[infoBarContainerController_ view]];
946 if ([self tabContentArea]) 944 if ([self tabContentArea])
947 [subviews addObject:[self tabContentArea]]; 945 [subviews addObject:[self tabContentArea]];
948 if ([self placeBookmarkBarBelowInfoBar]) { 946 if ([self placeBookmarkBarBelowInfoBar]) {
949 if ([bookmarkBarController_ view]) 947 if ([bookmarkBarController_ view])
950 [subviews addObject:[bookmarkBarController_ view]]; 948 [subviews addObject:[bookmarkBarController_ view]];
951 if (floatingBarBackingView_) 949 if (floatingBarBackingView_)
952 [subviews addObject:floatingBarBackingView_]; 950 [subviews addObject:floatingBarBackingView_];
953 } else { 951 } else {
954 if (floatingBarBackingView_) 952 if (floatingBarBackingView_)
955 [subviews addObject:floatingBarBackingView_]; 953 [subviews addObject:floatingBarBackingView_];
956 if ([bookmarkBarController_ view]) 954 if ([bookmarkBarController_ view])
957 [subviews addObject:[bookmarkBarController_ view]]; 955 [subviews addObject:[bookmarkBarController_ view]];
958 } 956 }
959
960 if ([toolbarController_ view]) 957 if ([toolbarController_ view])
961 [subviews addObject:[toolbarController_ view]]; 958 [subviews addObject:[toolbarController_ view]];
959 if ([infoBarContainerController_ view])
960 [subviews addObject:[infoBarContainerController_ view]];
962 if ([findBarCocoaController_ view]) 961 if ([findBarCocoaController_ view])
963 [subviews addObject:[findBarCocoaController_ view]]; 962 [subviews addObject:[findBarCocoaController_ view]];
964 963
965 [self setContentViewSubviews:subviews]; 964 [self setContentViewSubviews:subviews];
966 } 965 }
967 966
968 - (void)setContentViewSubviews:(NSArray*)subviews { 967 - (void)setContentViewSubviews:(NSArray*)subviews {
969 // Subviews already match. 968 // Subviews already match.
970 if ([[self.window.contentView subviews] isEqual:subviews]) 969 if ([[self.window.contentView subviews] isEqual:subviews])
971 return; 970 return;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 1024
1026 [CATransaction commit]; 1025 [CATransaction commit];
1027 hasAdjustedTabStripWhileEnteringAppKitFullscreen_ = YES; 1026 hasAdjustedTabStripWhileEnteringAppKitFullscreen_ = YES;
1028 } 1027 }
1029 } else { 1028 } else {
1030 hasAdjustedTabStripWhileEnteringAppKitFullscreen_ = NO; 1029 hasAdjustedTabStripWhileEnteringAppKitFullscreen_ = NO;
1031 } 1030 }
1032 } 1031 }
1033 1032
1034 @end // @implementation BrowserWindowController(Private) 1033 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/browser_window_layout.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698