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

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: Review comments 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..ffaae11522d5c581107e08c4c31b15899c525a6d 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,14 @@
}
break;
- case info_bubble::kAlignRightEdgeToAnchorEdge:
- origin.x -= NSWidth([window frame]);
+ case info_bubble::kAlignTrailingEdgeToAnchorEdge:
+ if (!isRTL)
+ origin.x -= NSWidth([window frame]);
break;
- case info_bubble::kAlignLeftEdgeToAnchorEdge:
- // Nothing to do.
+ case info_bubble::kAlignLeadingEdgeToAnchorEdge:
+ if (isRTL)
+ origin.x -= NSWidth([window frame]);
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