| 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 <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 [browserActionsContainerView_ setGrippyPinned:YES]; | 889 [browserActionsContainerView_ setGrippyPinned:YES]; |
| 890 NSRect containerFrame = [browserActionsContainerView_ frame]; | 890 NSRect containerFrame = [browserActionsContainerView_ frame]; |
| 891 // Determine how much the container needs to move in case it's overlapping | 891 // Determine how much the container needs to move in case it's overlapping |
| 892 // with the location bar. | 892 // with the location bar. |
| 893 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { | 893 if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| 894 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); | 894 CGFloat dX = NSMaxX(containerFrame) - NSMinX([locationBar_ frame]); |
| 895 containerFrame.size.width -= dX; | 895 containerFrame.size.width -= dX; |
| 896 } else { | 896 } else { |
| 897 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; | 897 CGFloat dX = NSMaxX([locationBar_ frame]) - containerFrame.origin.x; |
| 898 containerFrame = NSOffsetRect(containerFrame, dX, 0); | 898 containerFrame = NSOffsetRect(containerFrame, dX, 0); |
| 899 containerFrame.size.width -= dX; |
| 899 } | 900 } |
| 900 [browserActionsContainerView_ setFrame:containerFrame]; | 901 [browserActionsContainerView_ setFrame:containerFrame]; |
| 901 } else if (!locationBarAtMinSize_ && | 902 } else if (!locationBarAtMinSize_ && |
| 902 [browserActionsContainerView_ grippyPinned]) { | 903 [browserActionsContainerView_ grippyPinned]) { |
| 903 // Expand out the container until it hits the saved size, then unpin the | 904 // Expand out the container until it hits the saved size, then unpin the |
| 904 // grippy. | 905 // grippy. |
| 905 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. | 906 // Add 0.1 pixel so that it doesn't hit the minimum width codepath above. |
| 906 CGFloat dX = NSWidth([locationBar_ frame]) - | 907 CGFloat dX = NSWidth([locationBar_ frame]) - |
| 907 (kMinimumLocationBarWidth + 0.1); | 908 (kMinimumLocationBarWidth + 0.1); |
| 908 NSRect containerFrame = [browserActionsContainerView_ frame]; | 909 NSRect containerFrame = [browserActionsContainerView_ frame]; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1108 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1108 // Do nothing. | 1109 // Do nothing. |
| 1109 } | 1110 } |
| 1110 | 1111 |
| 1111 // (URLDropTargetController protocol) | 1112 // (URLDropTargetController protocol) |
| 1112 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1113 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1113 return drag_util::IsUnsupportedDropData(profile_, info); | 1114 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1114 } | 1115 } |
| 1115 | 1116 |
| 1116 @end | 1117 @end |
| OLD | NEW |