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

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: Updated comment 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // https://code.google.com/p/chromium/issues/detail?id=526327#c3.
1117 if (base::mac::IsOSMavericks() && !enterFullScreen)
1118 return NO;
1119
1121 NSView* root = [[self.window contentView] superview]; 1120 NSView* root = [[self.window contentView] superview];
1122 if (!root.layer) 1121 if (!root.layer)
1123 return NO; 1122 return NO;
1124 1123
1125 // AppKit on OSX 10.9 has a bug for applications linked against OSX 10.8 SDK 1124 // 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 1125 // and earlier. Under specific circumstances, it prevents the custom AppKit
1127 // transition from working well. See http://crbug.com/396980 for more 1126 // transition from working well. See http://crbug.com/396980 for more
1128 // details. 1127 // details.
1129 if ([[self class] systemSettingsRequireMavericksAppKitFullscreenHack] && 1128 if ([[self class] systemSettingsRequireMavericksAppKitFullscreenHack] &&
1130 ![[[self window] screen] isEqual:[[NSScreen screens] firstObject]]) { 1129 ![[[self window] screen] isEqual:[[NSScreen screens] firstObject]]) {
(...skipping 18 matching lines...) Expand all
1149 1148
1150 - (NSArray*)customWindowsToExitFullScreenForWindow:(NSWindow*)window { 1149 - (NSArray*)customWindowsToExitFullScreenForWindow:(NSWindow*)window {
1151 DCHECK([window isEqual:self.window]); 1150 DCHECK([window isEqual:self.window]);
1152 1151
1153 if (![self shouldUseCustomAppKitFullscreenTransition:NO]) 1152 if (![self shouldUseCustomAppKitFullscreenTransition:NO])
1154 return nil; 1153 return nil;
1155 1154
1156 FramedBrowserWindow* framedBrowserWindow = 1155 FramedBrowserWindow* framedBrowserWindow =
1157 base::mac::ObjCCast<FramedBrowserWindow>([self window]); 1156 base::mac::ObjCCast<FramedBrowserWindow>([self window]);
1158 fullscreenTransition_.reset([[BrowserWindowFullscreenTransition alloc] 1157 fullscreenTransition_.reset([[BrowserWindowFullscreenTransition alloc]
1159 initExitWithWindow:framedBrowserWindow 1158 initExitWithWindow:framedBrowserWindow
1160 frame:savedRegularWindowFrame_]); 1159 frame:savedRegularWindowFrame_
1160 tabStripBackgroundView:[self tabStripBackgroundView]]);
1161 1161
1162 return [fullscreenTransition_ customWindowsForFullScreenTransition]; 1162 return [fullscreenTransition_ customWindowsForFullScreenTransition];
1163 } 1163 }
1164 1164
1165 - (void)window:(NSWindow*)window 1165 - (void)window:(NSWindow*)window
1166 startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration { 1166 startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration {
1167 DCHECK([window isEqual:self.window]); 1167 DCHECK([window isEqual:self.window]);
1168 [fullscreenTransition_ startCustomFullScreenAnimationWithDuration:duration]; 1168 [fullscreenTransition_ startCustomFullScreenAnimationWithDuration:duration];
1169 1169
1170 base::AutoReset<BOOL> autoReset(&blockLayoutSubviews_, NO); 1170 base::AutoReset<BOOL> autoReset(&blockLayoutSubviews_, NO);
(...skipping 21 matching lines...) Expand all
1192 return browser_->tab_strip_model()->GetActiveWebContents(); 1192 return browser_->tab_strip_model()->GetActiveWebContents();
1193 } 1193 }
1194 1194
1195 - (PermissionBubbleManager*)permissionBubbleManager { 1195 - (PermissionBubbleManager*)permissionBubbleManager {
1196 if (WebContents* contents = [self webContents]) 1196 if (WebContents* contents = [self webContents])
1197 return PermissionBubbleManager::FromWebContents(contents); 1197 return PermissionBubbleManager::FromWebContents(contents);
1198 return nil; 1198 return nil;
1199 } 1199 }
1200 1200
1201 @end // @implementation BrowserWindowController(Private) 1201 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698