Chromium Code Reviews| Index: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm |
| index 44b5cbc103699d6a2cc9f272af7f5cc7f17cb873..e31e3c5f5a13ea687d58bbac2db2db104233242d 100644 |
| --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm |
| +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm |
| @@ -20,6 +20,7 @@ |
| #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
| #import "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" |
| #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| +#import "chrome/browser/ui/cocoa/l10n_util.h" |
| #import "chrome/browser/ui/cocoa/menu_button.h" |
| #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| #include "chrome/browser/ui/extensions/extension_message_bubble_bridge.h" |
| @@ -581,11 +582,15 @@ void ToolbarActionsBarBridge::ShowToolbarActionBubble( |
| if (NSMinX([button frameAfterAnimation]) == NSMinX(buttonFrame)) |
| continue; |
| - // We set the x-origin by calculating the proper distance from the right |
| + // In LTR, We set the x-origin by calculating the proper distance from the |
| + // right |
| // edge in the container so that, if the container is animating, the |
|
tapted
2017/01/04 06:08:09
nit: rewrap
lgrey
2017/01/04 17:36:38
Done.
|
| // button appears stationary. |
| - buttonFrame.origin.x = NSWidth([containerView_ frame]) - |
| - (toolbarActionsBar_->GetPreferredSize().width() - NSMinX(buttonFrame)); |
| + if (!cocoa_l10n_util::ShouldDoExperimentalRTLLayout()) { |
| + buttonFrame.origin.x = NSWidth([containerView_ frame]) - |
| + (toolbarActionsBar_->GetPreferredSize().width() - |
| + NSMinX(buttonFrame)); |
| + } |
| [button setFrame:buttonFrame animate:NO]; |
| } |
| } |
| @@ -783,9 +788,16 @@ void ToolbarActionsBarBridge::ShowToolbarActionBubble( |
| } |
| - (void)updateGrippyCursors { |
| + BOOL canClose = [self visibleButtonCount] > 0; |
| + BOOL canOpen = toolbarActionsBar_->GetIconCount() != [buttons_ count]; |
| + [containerView_ |
| + setCanDragLeft:cocoa_l10n_util::ShouldDoExperimentalRTLLayout() |
| + ? canClose |
| + : canOpen]; |
| [containerView_ |
| - setCanDragLeft:toolbarActionsBar_->GetIconCount() != [buttons_ count]]; |
| - [containerView_ setCanDragRight:[self visibleButtonCount] > 0]; |
| + setCanDragRight:cocoa_l10n_util::ShouldDoExperimentalRTLLayout() |
| + ? canOpen |
| + : canClose]; |
| [[containerView_ window] invalidateCursorRectsForView:containerView_]; |
| } |