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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_base_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
Index: chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
index cb9f7a1a57e2f4d0581ec87f11c4f8e0268da3a4..7f5576cf15c776157709aa41c64e819e67b83cea 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_base_controller.mm
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/base_bubble_controller.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#include "chrome/browser/ui/cocoa/l10n_util.h"
#import "chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.h"
#import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
#include "components/signin/core/common/profile_management_switches.h"
@@ -158,7 +159,9 @@ bool ProfileUpdateObserver::HasAvatarError() {
// The new avatar bubble does not have an arrow, and it should be anchored
// to the edge of the avatar button.
- int anchorX = NSMaxX([anchor bounds]) - kMenuXOffsetAdjust;
+ int anchorX = cocoa_l10n_util::ShouldDoExperimentalRTLLayout()
+ ? NSMinX([anchor bounds]) + kMenuXOffsetAdjust
+ : NSMaxX([anchor bounds]) - kMenuXOffsetAdjust;
NSPoint point = NSMakePoint(anchorX,
NSMaxY([anchor bounds]) + kMenuYOffsetAdjust);
point = [anchor convertPoint:point toView:nil];
« no previous file with comments | « chrome/browser/ui/cocoa/info_bubble_view.h ('k') | chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698