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

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

Issue 1408033010: Fix for Exit Fullscreen Animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 5 years, 1 month 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 #import "base/auto_reset.h" 9 #import "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 return NO; 1101 return NO;
1102 if (!enteringAppKitFullscreen_) 1102 if (!enteringAppKitFullscreen_)
1103 return NO; 1103 return NO;
1104 if (enteringAppKitFullscreenOnPrimaryScreen_) 1104 if (enteringAppKitFullscreenOnPrimaryScreen_)
1105 return NO; 1105 return NO;
1106 1106
1107 return YES; 1107 return YES;
1108 } 1108 }
1109 1109
1110 - (BOOL)shouldUseCustomAppKitFullscreenTransition:(BOOL)enterFullScreen { 1110 - (BOOL)shouldUseCustomAppKitFullscreenTransition:(BOOL)enterFullScreen {
1111 // We are temporary disabling exit fullscreen animation because it only 1111 // Custom fullscreen transitions should only be available in OSX 10.10+.
1112 // works on OSX 10.10.
1113 // TODO(spqchan): Fix exit fullscreen animation so that it works on all
1114 // OSX versions.
1115 if (!enterFullScreen)
1116 return NO;
1117
1118 if (base::mac::IsOSMountainLionOrEarlier()) 1112 if (base::mac::IsOSMountainLionOrEarlier())
1119 return NO; 1113 return NO;
1120 1114
1115 // Disable the custom exit animation in OSX 10.9.
1116 if (base::mac::IsOSMavericks() && !enterFullScreen)
erikchen 2015/11/09 18:29:21 Why? Add a link to a crbug post or add more detail
spqchan 2015/11/09 22:27:19 Done.
erikchen 2015/11/10 02:15:43 Use the link: https://code.google.com/p/chromium/
spqchan 2015/11/10 18:45:31 Done.
1117 return NO;
1118
1121 NSView* root = [[self.window contentView] superview]; 1119 NSView* root = [[self.window contentView] superview];
1122 if (!root.layer) 1120 if (!root.layer)
1123 return NO; 1121 return NO;
1124 1122
1125 // AppKit on OSX 10.9 has a bug for applications linked against OSX 10.8 SDK 1123 // AppKit on OSX 10.9 has a bug for applications linked against OSX 10.8 SDK
1126 // and earlier. Under specific circumstances, it prevents the custom AppKit 1124 // and earlier. Under specific circumstances, it prevents the custom AppKit
1127 // transition from working well. See http://crbug.com/396980 for more 1125 // transition from working well. See http://crbug.com/396980 for more
1128 // details. 1126 // details.
1129 if ([[self class] systemSettingsRequireMavericksAppKitFullscreenHack] && 1127 if ([[self class] systemSettingsRequireMavericksAppKitFullscreenHack] &&
1130 ![[[self window] screen] isEqual:[[NSScreen screens] firstObject]]) { 1128 ![[[self window] screen] isEqual:[[NSScreen screens] firstObject]]) {
(...skipping 18 matching lines...) Expand all
1149 1147
1150 - (NSArray*)customWindowsToExitFullScreenForWindow:(NSWindow*)window { 1148 - (NSArray*)customWindowsToExitFullScreenForWindow:(NSWindow*)window {
1151 DCHECK([window isEqual:self.window]); 1149 DCHECK([window isEqual:self.window]);
1152 1150
1153 if (![self shouldUseCustomAppKitFullscreenTransition:NO]) 1151 if (![self shouldUseCustomAppKitFullscreenTransition:NO])
1154 return nil; 1152 return nil;
1155 1153
1156 FramedBrowserWindow* framedBrowserWindow = 1154 FramedBrowserWindow* framedBrowserWindow =
1157 base::mac::ObjCCast<FramedBrowserWindow>([self window]); 1155 base::mac::ObjCCast<FramedBrowserWindow>([self window]);
1158 fullscreenTransition_.reset([[BrowserWindowFullscreenTransition alloc] 1156 fullscreenTransition_.reset([[BrowserWindowFullscreenTransition alloc]
1159 initExitWithWindow:framedBrowserWindow 1157 initExitWithWindow:framedBrowserWindow
1160 frame:savedRegularWindowFrame_]); 1158 frame:savedRegularWindowFrame_
1159 tabStripBackgroundView:[self tabStripBackgroundView]]);
1161 1160
1162 return [fullscreenTransition_ customWindowsForFullScreenTransition]; 1161 return [fullscreenTransition_ customWindowsForFullScreenTransition];
1163 } 1162 }
1164 1163
1165 - (void)window:(NSWindow*)window 1164 - (void)window:(NSWindow*)window
1166 startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration { 1165 startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration {
1167 DCHECK([window isEqual:self.window]); 1166 DCHECK([window isEqual:self.window]);
1168 [fullscreenTransition_ startCustomFullScreenAnimationWithDuration:duration]; 1167 [fullscreenTransition_ startCustomFullScreenAnimationWithDuration:duration];
1169 1168
1170 base::AutoReset<BOOL> autoReset(&blockLayoutSubviews_, NO); 1169 base::AutoReset<BOOL> autoReset(&blockLayoutSubviews_, NO);
(...skipping 21 matching lines...) Expand all
1192 return browser_->tab_strip_model()->GetActiveWebContents(); 1191 return browser_->tab_strip_model()->GetActiveWebContents();
1193 } 1192 }
1194 1193
1195 - (PermissionBubbleManager*)permissionBubbleManager { 1194 - (PermissionBubbleManager*)permissionBubbleManager {
1196 if (WebContents* contents = [self webContents]) 1195 if (WebContents* contents = [self webContents])
1197 return PermissionBubbleManager::FromWebContents(contents); 1196 return PermissionBubbleManager::FromWebContents(contents);
1198 return nil; 1197 return nil;
1199 } 1198 }
1200 1199
1201 @end // @implementation BrowserWindowController(Private) 1200 @end // @implementation BrowserWindowController(Private)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698