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 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 } | 662 } |
663 | 663 |
664 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { | 664 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { |
665 CGFloat locationBarXPos = NSMaxX([[locationBar_ animator] frame]); | 665 CGFloat locationBarXPos = NSMaxX([[locationBar_ animator] frame]); |
666 CGFloat leftDistance; | 666 CGFloat leftDistance; |
667 | 667 |
668 if ([browserActionsContainerView_ isHidden]) { | 668 if ([browserActionsContainerView_ isHidden]) { |
669 CGFloat edgeXPos = [wrenchButton_ frame].origin.x; | 669 CGFloat edgeXPos = [wrenchButton_ frame].origin.x; |
670 leftDistance = edgeXPos - locationBarXPos - kWrenchMenuLeftPadding; | 670 leftDistance = edgeXPos - locationBarXPos - kWrenchMenuLeftPadding; |
671 } else { | 671 } else { |
672 NSRect containerFrame = animate ? | 672 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - |
673 [browserActionsContainerView_ animationEndFrame] : | 673 locationBarXPos; |
674 [browserActionsContainerView_ frame]; | |
675 | |
676 leftDistance = containerFrame.origin.x - locationBarXPos; | |
677 } | 674 } |
678 if (leftDistance != 0.0) | 675 if (leftDistance != 0.0) |
679 [self adjustLocationSizeBy:leftDistance animate:animate]; | 676 [self adjustLocationSizeBy:leftDistance animate:animate]; |
680 } | 677 } |
681 | 678 |
682 - (void)maintainMinimumLocationBarWidth { | 679 - (void)maintainMinimumLocationBarWidth { |
683 CGFloat locationBarWidth = NSWidth([locationBar_ frame]); | 680 CGFloat locationBarWidth = NSWidth([locationBar_ frame]); |
684 locationBarAtMinSize_ = locationBarWidth <= kMinimumLocationBarWidth; | 681 locationBarAtMinSize_ = locationBarWidth <= kMinimumLocationBarWidth; |
685 if (locationBarAtMinSize_) { | 682 if (locationBarAtMinSize_) { |
686 CGFloat dX = kMinimumLocationBarWidth - locationBarWidth; | 683 CGFloat dX = kMinimumLocationBarWidth - locationBarWidth; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 850 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
854 // Do nothing. | 851 // Do nothing. |
855 } | 852 } |
856 | 853 |
857 // (URLDropTargetController protocol) | 854 // (URLDropTargetController protocol) |
858 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 855 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
859 return drag_util::IsUnsupportedDropData(profile_, info); | 856 return drag_util::IsUnsupportedDropData(profile_, info); |
860 } | 857 } |
861 | 858 |
862 @end | 859 @end |
OLD | NEW |