| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 [window performSelector:@selector(close) withObject:nil afterDelay:0]; | 364 [window performSelector:@selector(close) withObject:nil afterDelay:0]; |
| 365 } | 365 } |
| 366 | 366 |
| 367 void NativeWidgetMac::CloseNow() { | 367 void NativeWidgetMac::CloseNow() { |
| 368 if (!bridge_) | 368 if (!bridge_) |
| 369 return; | 369 return; |
| 370 | 370 |
| 371 // Notify observers while |bridged_| is still valid. | 371 // Notify observers while |bridged_| is still valid. |
| 372 delegate_->OnNativeWidgetDestroying(); | 372 delegate_->OnNativeWidgetDestroying(); |
| 373 // Reset |bridge_| to NULL before destroying it. | 373 // Reset |bridge_| to NULL before destroying it. |
| 374 scoped_ptr<BridgedNativeWidget> bridge(std::move(bridge_)); | 374 std::unique_ptr<BridgedNativeWidget> bridge(std::move(bridge_)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void NativeWidgetMac::Show() { | 377 void NativeWidgetMac::Show() { |
| 378 ShowWithWindowState(ui::SHOW_STATE_NORMAL); | 378 ShowWithWindowState(ui::SHOW_STATE_NORMAL); |
| 379 } | 379 } |
| 380 | 380 |
| 381 void NativeWidgetMac::Hide() { | 381 void NativeWidgetMac::Hide() { |
| 382 if (!bridge_) | 382 if (!bridge_) |
| 383 return; | 383 return; |
| 384 | 384 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 731 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 732 } | 732 } |
| 733 | 733 |
| 734 - (void)animationDidEnd:(NSAnimation*)animation { | 734 - (void)animationDidEnd:(NSAnimation*)animation { |
| 735 [window_ close]; | 735 [window_ close]; |
| 736 [animation_ setDelegate:nil]; | 736 [animation_ setDelegate:nil]; |
| 737 [self release]; | 737 [self release]; |
| 738 } | 738 } |
| 739 | 739 |
| 740 @end | 740 @end |
| OLD | NEW |