Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Unified Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 2607533004: [Mac] Flip toolbar in RTL (Closed)
Patch Set: Remove unused method Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_];
}

Powered by Google App Engine
This is Rietveld 408576698