| 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/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:YES]; | 833 [self pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:YES]; |
| 834 } | 834 } |
| 835 | 835 |
| 836 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { | 836 - (void)pinLocationBarToLeftOfBrowserActionsContainerAndAnimate:(BOOL)animate { |
| 837 CGFloat locationBarXPos = NSMaxX([locationBar_ frame]); | 837 CGFloat locationBarXPos = NSMaxX([locationBar_ frame]); |
| 838 CGFloat leftDistance = 0.0; | 838 CGFloat leftDistance = 0.0; |
| 839 | 839 |
| 840 if ([browserActionsContainerView_ isHidden]) { | 840 if ([browserActionsContainerView_ isHidden]) { |
| 841 CGFloat edgeXPos = [appMenuButton_ frame].origin.x; | 841 CGFloat edgeXPos = [appMenuButton_ frame].origin.x; |
| 842 leftDistance = edgeXPos - locationBarXPos - | 842 leftDistance = edgeXPos - locationBarXPos - |
| 843 [ToolbarController appMenuLeftPadding]; | 843 [ToolbarController appMenuLeftPadding] - kButtonInset; |
| 844 } else { | 844 } else { |
| 845 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - | 845 leftDistance = NSMinX([browserActionsContainerView_ animationEndFrame]) - |
| 846 locationBarXPos; | 846 locationBarXPos; |
| 847 // Equalize the distance between the location bar and the first extension | 847 // Equalize the distance between the location bar and the first extension |
| 848 // button, and the distance between the location bar and home/reload button. | 848 // button, and the distance between the location bar and home/reload button. |
| 849 leftDistance -= kButtonInset; | 849 leftDistance -= kButtonInset; |
| 850 } | 850 } |
| 851 if (leftDistance != 0.0) | 851 if (leftDistance != 0.0) |
| 852 [self adjustLocationSizeBy:leftDistance animate:animate]; | 852 [self adjustLocationSizeBy:leftDistance animate:animate]; |
| 853 else | 853 else |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1079 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1080 // Do nothing. | 1080 // Do nothing. |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 // (URLDropTargetController protocol) | 1083 // (URLDropTargetController protocol) |
| 1084 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1084 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1085 return drag_util::IsUnsupportedDropData(profile_, info); | 1085 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 @end | 1088 @end |
| OLD | NEW |