| Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| index d380384d8778ccfec5f89e8513b72c61afc6de5f..97eb5f57a8c69e4dc60dc633054ae5fa214548fe 100644
|
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
|
| @@ -1180,14 +1180,17 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
|
| [self setNewTabButtonHoverState:shouldShowHover];
|
|
|
| // Move the new tab button into place. We want to animate the new tab
|
| - // button if it's moving to the left (closing a tab), but not when it's
|
| - // moving to the right (inserting a new tab). If moving right, we need
|
| + // button if it's moving back (closing a tab), but not when it's
|
| + // moving forward (inserting a new tab). If moving forward, we need
|
| // to use a very small duration to make sure we cancel any in-flight
|
| // animation to the left.
|
| if (visible && animate) {
|
| ScopedNSAnimationContextGroup localAnimationGroup(true);
|
| - BOOL movingLeft = NSMinX(newTabNewFrame) < NSMinX(newTabTargetFrame_);
|
| - if (!movingLeft) {
|
| + BOOL movingBack = NSMinX(newTabNewFrame) < NSMinX(newTabTargetFrame_);
|
| + if (cocoa_l10n_util::ShouldDoExperimentalRTLLayout())
|
| + movingBack = !movingBack;
|
| +
|
| + if (!movingBack) {
|
| localAnimationGroup.SetCurrentContextShortestDuration();
|
| }
|
| [[newTabButton_ animator] setFrame:newTabNewFrame];
|
|
|