| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/views/widget/native_widget_mac.h" | 5 #include "ui/views/widget/native_widget_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 bool NativeWidgetPrivate::IsMouseButtonDown() { | 712 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 713 return [NSEvent pressedMouseButtons] != 0; | 713 return [NSEvent pressedMouseButtons] != 0; |
| 714 } | 714 } |
| 715 | 715 |
| 716 // static | 716 // static |
| 717 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { | 717 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { |
| 718 NOTIMPLEMENTED(); | 718 NOTIMPLEMENTED(); |
| 719 return gfx::FontList(); | 719 return gfx::FontList(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 // static |
| 723 gfx::NativeView NativeWidgetPrivate::GetCapture(gfx::NativeView native_view) { |
| 724 NOTIMPLEMENTED(); |
| 725 return nullptr; |
| 726 } |
| 727 |
| 722 } // namespace internal | 728 } // namespace internal |
| 723 } // namespace views | 729 } // namespace views |
| 724 | 730 |
| 725 @implementation ViewsNSWindowCloseAnimator | 731 @implementation ViewsNSWindowCloseAnimator |
| 726 | 732 |
| 727 - (id)initWithWindow:(NSWindow*)window { | 733 - (id)initWithWindow:(NSWindow*)window { |
| 728 if ((self = [super init])) { | 734 if ((self = [super init])) { |
| 729 window_.reset([window retain]); | 735 window_.reset([window retain]); |
| 730 animation_.reset( | 736 animation_.reset( |
| 731 [[ConstrainedWindowAnimationHide alloc] initWithWindow:window]); | 737 [[ConstrainedWindowAnimationHide alloc] initWithWindow:window]); |
| 732 [animation_ setDelegate:self]; | 738 [animation_ setDelegate:self]; |
| 733 [animation_ setAnimationBlockingMode:NSAnimationNonblocking]; | 739 [animation_ setAnimationBlockingMode:NSAnimationNonblocking]; |
| 734 [animation_ startAnimation]; | 740 [animation_ startAnimation]; |
| 735 } | 741 } |
| 736 return self; | 742 return self; |
| 737 } | 743 } |
| 738 | 744 |
| 739 + (void)closeWindowWithAnimation:(NSWindow*)window { | 745 + (void)closeWindowWithAnimation:(NSWindow*)window { |
| 740 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 746 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 741 } | 747 } |
| 742 | 748 |
| 743 - (void)animationDidEnd:(NSAnimation*)animation { | 749 - (void)animationDidEnd:(NSAnimation*)animation { |
| 744 [window_ close]; | 750 [window_ close]; |
| 745 [animation_ setDelegate:nil]; | 751 [animation_ setDelegate:nil]; |
| 746 [self release]; | 752 [self release]; |
| 747 } | 753 } |
| 748 | 754 |
| 749 @end | 755 @end |
| OLD | NEW |