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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 848153005: Revert of mac: Implement custom AppKit Enter Fullscreen transition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index f2c086b0882389ef0b9d17fde3ed128909913441..36a9ccd5d0fde2f556e7de584b576f03888fcd0c 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -22,7 +22,6 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window_state.h"
-#import "chrome/browser/ui/cocoa/browser_window_enter_fullscreen_transition.h"
#import "chrome/browser/ui/cocoa/browser_window_layout.h"
#import "chrome/browser/ui/cocoa/dev_tools_controller.h"
#import "chrome/browser/ui/cocoa/fast_resize_view.h"
@@ -683,8 +682,6 @@
}
- (void)windowDidEnterFullScreen:(NSNotification*)notification {
- enterFullscreenTransition_.reset();
-
// In Yosemite, some combination of the titlebar and toolbar always show in
// full-screen mode. We do not want either to show. Search for the window that
// contains the views, and hide it. There is no need to ever unhide the view.
@@ -1005,16 +1002,13 @@
}
}
-+ (BOOL)systemSettingsRequireMavericksAppKitFullscreenHack {
+- (BOOL)shouldUseMavericksAppKitFullscreenHack {
if (!base::mac::IsOSMavericks())
return NO;
- return [NSScreen respondsToSelector:@selector(screensHaveSeparateSpaces)] &&
- [NSScreen screensHaveSeparateSpaces];
-}
-
-- (BOOL)shouldUseMavericksAppKitFullscreenHack {
- if (![[self class] systemSettingsRequireMavericksAppKitFullscreenHack])
+ if (![NSScreen respondsToSelector:@selector(screensHaveSeparateSpaces)] ||
+ ![NSScreen screensHaveSeparateSpaces]) {
return NO;
+ }
if (!enteringAppKitFullscreen_)
return NO;
if (enteringAppKitFullscreenOnPrimaryScreen_)
@@ -1023,50 +1017,4 @@
return YES;
}
-- (BOOL)shouldUseCustomAppKitFullscreenTransition {
- if (base::mac::IsOSMountainLionOrEarlier())
- return NO;
-
- NSView* root = [[self.window contentView] superview];
- if (!root.layer)
- return NO;
-
- // AppKit on OSX 10.9 has a bug for applications linked against OSX 10.8 SDK
- // and earlier. Under specific circumstances, it prevents the custom AppKit
- // transition from working well. See http://crbug.com/396980 for more
- // details.
- if ([[self class] systemSettingsRequireMavericksAppKitFullscreenHack] &&
- ![[[self window] screen] isEqual:[[NSScreen screens] objectAtIndex:0]]) {
- return NO;
- }
-
- return YES;
-}
-
-- (NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow*)window {
- DCHECK([window isEqual:self.window]);
-
- if (![self shouldUseCustomAppKitFullscreenTransition])
- return nil;
-
- enterFullscreenTransition_.reset(
- [[BrowserWindowEnterFullscreenTransition alloc]
- initWithWindow:self.window]);
- return [enterFullscreenTransition_ customWindowsToEnterFullScreen];
-}
-
-- (void)window:(NSWindow*)window
- startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration {
- DCHECK([window isEqual:self.window]);
- [enterFullscreenTransition_
- startCustomAnimationToEnterFullScreenWithDuration:duration];
-}
-
-- (BOOL)shouldConstrainFrameRect {
- if ([enterFullscreenTransition_ shouldWindowBeUnconstrained])
- return NO;
-
- return [super shouldConstrainFrameRect];
-}
-
@end // @implementation BrowserWindowController(Private)

Powered by Google App Engine
This is Rietveld 408576698