| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 } | 544 } |
| 545 | 545 |
| 546 gfx::Rect NativeWidgetMac::GetWorkAreaBoundsInScreen() const { | 546 gfx::Rect NativeWidgetMac::GetWorkAreaBoundsInScreen() const { |
| 547 return gfx::ScreenRectFromNSRect([[GetNativeWindow() screen] visibleFrame]); | 547 return gfx::ScreenRectFromNSRect([[GetNativeWindow() screen] visibleFrame]); |
| 548 } | 548 } |
| 549 | 549 |
| 550 Widget::MoveLoopResult NativeWidgetMac::RunMoveLoop( | 550 Widget::MoveLoopResult NativeWidgetMac::RunMoveLoop( |
| 551 const gfx::Vector2d& drag_offset, | 551 const gfx::Vector2d& drag_offset, |
| 552 Widget::MoveLoopSource source, | 552 Widget::MoveLoopSource source, |
| 553 Widget::MoveLoopEscapeBehavior escape_behavior) { | 553 Widget::MoveLoopEscapeBehavior escape_behavior) { |
| 554 NOTIMPLEMENTED(); | 554 if (!bridge_) |
| 555 return Widget::MOVE_LOOP_CANCELED; | 555 return Widget::MOVE_LOOP_CANCELED; |
| 556 |
| 557 return bridge_->RunMoveLoop(drag_offset); |
| 556 } | 558 } |
| 557 | 559 |
| 558 void NativeWidgetMac::EndMoveLoop() { | 560 void NativeWidgetMac::EndMoveLoop() { |
| 559 NOTIMPLEMENTED(); | 561 if (bridge_) |
| 562 bridge_->EndMoveLoop(); |
| 560 } | 563 } |
| 561 | 564 |
| 562 void NativeWidgetMac::SetVisibilityChangedAnimationsEnabled(bool value) { | 565 void NativeWidgetMac::SetVisibilityChangedAnimationsEnabled(bool value) { |
| 563 NOTIMPLEMENTED(); | 566 NOTIMPLEMENTED(); |
| 564 } | 567 } |
| 565 | 568 |
| 566 void NativeWidgetMac::SetVisibilityAnimationDuration( | 569 void NativeWidgetMac::SetVisibilityAnimationDuration( |
| 567 const base::TimeDelta& duration) { | 570 const base::TimeDelta& duration) { |
| 568 NOTIMPLEMENTED(); | 571 NOTIMPLEMENTED(); |
| 569 } | 572 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 743 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 741 } | 744 } |
| 742 | 745 |
| 743 - (void)animationDidEnd:(NSAnimation*)animation { | 746 - (void)animationDidEnd:(NSAnimation*)animation { |
| 744 [window_ close]; | 747 [window_ close]; |
| 745 [animation_ setDelegate:nil]; | 748 [animation_ setDelegate:nil]; |
| 746 [self release]; | 749 [self release]; |
| 747 } | 750 } |
| 748 | 751 |
| 749 @end | 752 @end |
| OLD | NEW |