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

Side by Side Diff: ui/views/cocoa/views_nswindow_close_animator.mm

Issue 2061693003: MacViews: Suppress visibility changes during an asynchronous close. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Neater, but Linux, Windows disagree on WidgetTest.DesktopNativeWidgetVisibilityAfterCloseTest Created 4 years, 4 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
« no previous file with comments | « ui/views/cocoa/views_nswindow_close_animator.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/views/cocoa/views_nswindow_close_animator.h"
6
7 #import <AppKit/AppKit.h>
8
9 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
10
11 @interface ViewsNSWindowCloseAnimator : NSObject<NSAnimationDelegate>
12 - (id)initWithWindow:(NSWindow*)window;
13 @end
14
15 namespace views {
16
17 void CloseNativeWindowWithAnimation(NSWindow* window) {
18 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window];
19 }
20
21 } // namespace views
22
23 @implementation ViewsNSWindowCloseAnimator {
24 @private
25 base::scoped_nsobject<NSWindow> window_;
26 base::scoped_nsobject<NSAnimation> animation_;
27 }
28
29 - (id)initWithWindow:(NSWindow*)window {
30 if ((self = [super init])) {
31 window_.reset([window retain]);
32 animation_.reset(
33 [[ConstrainedWindowAnimationHide alloc] initWithWindow:window]);
34 [animation_ setDelegate:self];
35 [animation_ setAnimationBlockingMode:NSAnimationNonblocking];
36 [animation_ startAnimation];
37 }
38 return self;
39 }
40
41 - (void)animationDidEnd:(NSAnimation*)animation {
42 [window_ close];
43 [animation_ setDelegate:nil];
44 [self release];
45 }
46
47 @end
OLDNEW
« no previous file with comments | « ui/views/cocoa/views_nswindow_close_animator.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698