| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/panels/panel_window_controller_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 - (void)drag:(NSPoint)mouseLocation { | 767 - (void)drag:(NSPoint)mouseLocation { |
| 768 // Convert from Cocoa's screen coordinates to platform-indepedent screen | 768 // Convert from Cocoa's screen coordinates to platform-indepedent screen |
| 769 // coordinates because PanelManager method takes platform-indepedent screen | 769 // coordinates because PanelManager method takes platform-indepedent screen |
| 770 // coordinates. | 770 // coordinates. |
| 771 windowShim_->panel()->manager()->Drag( | 771 windowShim_->panel()->manager()->Drag( |
| 772 cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation)); | 772 cocoa_utils::ConvertPointFromCocoaCoordinates(mouseLocation)); |
| 773 } | 773 } |
| 774 | 774 |
| 775 - (void)setPanelFrame:(NSRect)frame | 775 - (void)setPanelFrame:(NSRect)frame |
| 776 animate:(BOOL)animate { | 776 animate:(BOOL)animate { |
| 777 [self updateTitleBarMinimizeRestoreButtonVisibility]; | |
| 778 | |
| 779 BOOL jumpToDestination = (!animateOnBoundsChange_ || !animate); | 777 BOOL jumpToDestination = (!animateOnBoundsChange_ || !animate); |
| 780 | 778 |
| 781 // If no animation is in progress, apply bounds change instantly. | 779 // If no animation is in progress, apply bounds change instantly. |
| 782 if (jumpToDestination && ![self isAnimatingBounds]) { | 780 if (jumpToDestination && ![self isAnimatingBounds]) { |
| 783 [[self window] setFrame:frame display:YES animate:NO]; | 781 [[self window] setFrame:frame display:YES animate:NO]; |
| 784 return; | 782 return; |
| 785 } | 783 } |
| 786 | 784 |
| 787 NSDictionary *windowResize = [NSDictionary dictionaryWithObjectsAndKeys: | 785 NSDictionary *windowResize = [NSDictionary dictionaryWithObjectsAndKeys: |
| 788 [self window], NSViewAnimationTargetKey, | 786 [self window], NSViewAnimationTargetKey, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 [[self window] setLevel:NSDockWindowLevel]; | 1007 [[self window] setLevel:NSDockWindowLevel]; |
| 1010 } | 1008 } |
| 1011 | 1009 |
| 1012 - (void)enableResizeByMouse:(BOOL)enable { | 1010 - (void)enableResizeByMouse:(BOOL)enable { |
| 1013 if (![self isWindowLoaded]) | 1011 if (![self isWindowLoaded]) |
| 1014 return; | 1012 return; |
| 1015 [[self window] invalidateCursorRectsForView:overlayView_]; | 1013 [[self window] invalidateCursorRectsForView:overlayView_]; |
| 1016 } | 1014 } |
| 1017 | 1015 |
| 1018 @end | 1016 @end |
| OLD | NEW |