| 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 [browserActionsContainerView_ setGrippyPinned:YES]; | 872 [browserActionsContainerView_ setGrippyPinned:YES]; |
| 873 NSRect containerFrame = [browserActionsContainerView_ frame]; | 873 NSRect containerFrame = [browserActionsContainerView_ frame]; |
| 874 // Determine how much the container needs to move in case it's overlapping | 874 // Determine how much the container needs to move in case it's overlapping |
| 875 // with the location bar. | 875 // with the location bar. |
| 876 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { | 876 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| 877 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); | 877 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); |
| 878 containerFrame.size.width -= dX; | 878 containerFrame.size.width -= dX; |
| 879 } else { | 879 } else { |
| 880 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; | 880 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; |
| 881 containerFrame = NSOffsetRect(containerFrame, dX, 0); | 881 containerFrame = NSOffsetRect(containerFrame, dX, 0); |
| 882 containerFrame.size.width -= dX; |
| 882 } | 883 } |
| 883 [browserActionsContainerView_ setFrame:containerFrame]; | 884 [browserActionsContainerView_ setFrame:containerFrame]; |
| 884 } else if (!locationBarAtMinSize_ && | 885 } else if (!locationBarAtMinSize_ && |
| 885 [browserActionsContainerView_ grippyPinned]) { | 886 [browserActionsContainerView_ grippyPinned]) { |
| 886 // Expand out the container until it hits the saved size, then unpin the | 887 // Expand out the container until it hits the saved size, then unpin the |
| 887 // grippy. | 888 // grippy. |
| 888 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. | 889 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. |
| 889 CGFloat dX = NSWidth([locationBar_ frame]) - | 890 CGFloat dX = NSWidth([locationBar_ frame]) - |
| 890 (kMinimumLocationBarWidth + 0.1); | 891 (kMinimumLocationBarWidth + 0.1); |
| 891 NSRect containerFrame = [browserActionsContainerView_ frame]; | 892 NSRect containerFrame = [browserActionsContainerView_ frame]; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1091 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1091 // Do nothing. | 1092 // Do nothing. |
| 1092 } | 1093 } |
| 1093 | 1094 |
| 1094 // (URLDropTargetController protocol) | 1095 // (URLDropTargetController protocol) |
| 1095 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1096 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1096 return drag_util::IsUnsupportedDropData(profile_, info); | 1097 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1097 } | 1098 } |
| 1098 | 1099 |
| 1099 @end | 1100 @end |
| OLD | NEW |