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

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

Issue 1850313002: Fix Fullscreen Animation Crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_fullscreen_transition.h" 5 #import "chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h"
6 6
7 #include <QuartzCore/QuartzCore.h> 7 #include <QuartzCore/QuartzCore.h>
8 8
9 #include "base/mac/bind_objc_block.h" 9 #include "base/mac/bind_objc_block.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 DCHECK_EQ(NSWidth(content.frame), expectedSize.width); 517 DCHECK_EQ(NSWidth(content.frame), expectedSize.width);
518 518
519 // Restore the state of the primary window and make it visible again. 519 // Restore the state of the primary window and make it visible again.
520 [primaryWindow_ setOpaque:primaryWindowInitialOpaque_]; 520 [primaryWindow_ setOpaque:primaryWindowInitialOpaque_];
521 [primaryWindow_ setBackgroundColor:primaryWindowInitialBackgroundColor_]; 521 [primaryWindow_ setBackgroundColor:primaryWindowInitialBackgroundColor_];
522 522
523 CALayer* root = [self rootLayerOfWindow:primaryWindow_]; 523 CALayer* root = [self rootLayerOfWindow:primaryWindow_];
524 [root removeAnimationForKey:kPrimaryWindowAnimationID]; 524 [root removeAnimationForKey:kPrimaryWindowAnimationID];
525 root.opacity = 1; 525 root.opacity = 1;
526 526
527 completedTransition_ = YES;
528
527 if (!isEnteringFullscreen_) 529 if (!isEnteringFullscreen_)
528 [controller_ exitFullscreenAnimationFinished]; 530 [controller_ exitFullscreenAnimationFinished];
529 } 531 }
530
531 completedTransition_ = YES;
532 } 532 }
533 533
534 - (CALayer*)rootLayerOfWindow:(NSWindow*)window { 534 - (CALayer*)rootLayerOfWindow:(NSWindow*)window {
535 return [[[window contentView] superview] layer]; 535 return [[[window contentView] superview] layer];
536 } 536 }
537 537
538 - (NSPoint)pointRelativeToCurrentScreen:(NSPoint)point { 538 - (NSPoint)pointRelativeToCurrentScreen:(NSPoint)point {
539 NSRect screenFrame = [[primaryWindow_ screen] frame]; 539 NSRect screenFrame = [[primaryWindow_ screen] frame];
540 return NSMakePoint(point.x - screenFrame.origin.x, 540 return NSMakePoint(point.x - screenFrame.origin.x,
541 point.y - screenFrame.origin.y); 541 point.y - screenFrame.origin.y);
542 } 542 }
543 543
544 @end 544 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698