| 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 "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
| 12 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h" | 12 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h" |
| 13 #import "ui/base/cocoa/window_size_constants.h" | 13 #import "ui/base/cocoa/window_size_constants.h" |
| 14 #include "ui/gfx/font_list.h" | 14 #include "ui/gfx/font_list.h" |
| 15 #import "ui/gfx/mac/coordinate_conversion.h" | 15 #import "ui/gfx/mac/coordinate_conversion.h" |
| 16 #import "ui/gfx/mac/nswindow_frame_controls.h" | 16 #import "ui/gfx/mac/nswindow_frame_controls.h" |
| 17 #include "ui/native_theme/native_theme.h" | 17 #include "ui/native_theme/native_theme.h" |
| 18 #include "ui/native_theme/native_theme_mac.h" |
| 18 #import "ui/views/cocoa/bridged_content_view.h" | 19 #import "ui/views/cocoa/bridged_content_view.h" |
| 19 #import "ui/views/cocoa/bridged_native_widget.h" | 20 #import "ui/views/cocoa/bridged_native_widget.h" |
| 20 #import "ui/views/cocoa/native_widget_mac_nswindow.h" | 21 #import "ui/views/cocoa/native_widget_mac_nswindow.h" |
| 21 #import "ui/views/cocoa/views_nswindow_delegate.h" | 22 #import "ui/views/cocoa/views_nswindow_delegate.h" |
| 22 #include "ui/views/widget/widget_delegate.h" | 23 #include "ui/views/widget/widget_delegate.h" |
| 23 #include "ui/views/window/native_frame_view.h" | 24 #include "ui/views/window/native_frame_view.h" |
| 24 | 25 |
| 25 // Self-owning animation delegate that starts a hide animation, then calls | 26 // Self-owning animation delegate that starts a hide animation, then calls |
| 26 // -[NSWindow close] when the animation ends, releasing itself. | 27 // -[NSWindow close] when the animation ends, releasing itself. |
| 27 @interface ViewsNSWindowCloseAnimator : NSObject<NSAnimationDelegate> { | 28 @interface ViewsNSWindowCloseAnimator : NSObject<NSAnimationDelegate> { |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 const base::TimeDelta& duration) { | 545 const base::TimeDelta& duration) { |
| 545 NOTIMPLEMENTED(); | 546 NOTIMPLEMENTED(); |
| 546 } | 547 } |
| 547 | 548 |
| 548 void NativeWidgetMac::SetVisibilityAnimationTransition( | 549 void NativeWidgetMac::SetVisibilityAnimationTransition( |
| 549 Widget::VisibilityTransition transition) { | 550 Widget::VisibilityTransition transition) { |
| 550 NOTIMPLEMENTED(); | 551 NOTIMPLEMENTED(); |
| 551 } | 552 } |
| 552 | 553 |
| 553 ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const { | 554 ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const { |
| 554 return ui::NativeTheme::instance(); | 555 return ui::NativeThemeMac::instance(); |
| 555 } | 556 } |
| 556 | 557 |
| 557 void NativeWidgetMac::OnRootViewLayout() { | 558 void NativeWidgetMac::OnRootViewLayout() { |
| 558 // Ensure possible changes to the non-client view (e.g. Minimum/Maximum size) | 559 // Ensure possible changes to the non-client view (e.g. Minimum/Maximum size) |
| 559 // propagate through to the NSWindow properties. | 560 // propagate through to the NSWindow properties. |
| 560 OnSizeConstraintsChanged(); | 561 OnSizeConstraintsChanged(); |
| 561 } | 562 } |
| 562 | 563 |
| 563 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { | 564 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { |
| 564 return false; | 565 return false; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 714 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 714 } | 715 } |
| 715 | 716 |
| 716 - (void)animationDidEnd:(NSAnimation*)animation { | 717 - (void)animationDidEnd:(NSAnimation*)animation { |
| 717 [window_ close]; | 718 [window_ close]; |
| 718 [animation_ setDelegate:nil]; | 719 [animation_ setDelegate:nil]; |
| 719 [self release]; | 720 [self release]; |
| 720 } | 721 } |
| 721 | 722 |
| 722 @end | 723 @end |
| OLD | NEW |