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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 2490323002: [Mac] Anchor profile switcher to left side of avatar button in RTL (Closed)
Patch Set: Make arrowless info bubble alignments RTL aware Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/base_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm
index 25666d202954b813c3e7784c267a18cd93a80f6c..17424b66871a8768e3c43b535cbb15ac87d2df98 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -14,6 +14,7 @@
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/info_bubble_view.h"
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
+#include "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
#include "components/bubble/bubble_controller.h"
#include "ui/base/cocoa/cocoa_base_utils.h"
@@ -403,6 +404,7 @@
NSWindow* window = [self window];
NSPoint origin = anchor_;
+ BOOL isRTL = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
switch ([bubble_ alignment]) {
case info_bubble::kAlignArrowToAnchor: {
NSSize offsets = NSMakeSize(info_bubble::kBubbleArrowXOffset +
@@ -434,12 +436,12 @@
}
break;
- case info_bubble::kAlignRightEdgeToAnchorEdge:
- origin.x -= NSWidth([window frame]);
+ case info_bubble::kAlignTrailingEdgeToAnchorEdge:
+ origin.x -= isRTL ? 0 : NSWidth([window frame]);
Nico 2016/11/15 18:25:22 nit: rather than use a ternary with 0, do if (!i
lgrey 2016/11/15 19:07:34 Done.
break;
- case info_bubble::kAlignLeftEdgeToAnchorEdge:
- // Nothing to do.
+ case info_bubble::kAlignLeadingEdgeToAnchorEdge:
+ origin.x -= isRTL ? NSWidth([window frame]) : 0;
Nico 2016/11/15 18:25:22 and here if (isRTL) ...
lgrey 2016/11/15 19:07:34 Done.
break;
default:
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698