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

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

Issue 2845003003: [Mac] Reverse bookmark buttons and menus in RTL (take 2) (Closed)
Patch Set: CL comments Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/cocoa/l10n_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/l10n_util.mm
diff --git a/chrome/browser/ui/cocoa/l10n_util.mm b/chrome/browser/ui/cocoa/l10n_util.mm
index 1479c1729d2e37debcc94390888ac07582d2fec9..99935ef996ba0489d1edc9eb348e6d8794a47d91 100644
--- a/chrome/browser/ui/cocoa/l10n_util.mm
+++ b/chrome/browser/ui/cocoa/l10n_util.mm
@@ -96,6 +96,30 @@ bool ShouldFlipWindowControlsInRTL() {
return ShouldDoExperimentalRTLLayout() && base::mac::IsAtLeastOS10_12();
}
+// TODO(lgrey): Remove these when all builds are on 10.12 SDK.
+#if defined(MAC_OS_X_VERSION_10_12) && \
+ (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)
+#warning LeadingCellImagePosition/TrailingCellImagePosition \
+ should be removed since the deployment target is >= 10.12
+#endif
+
+#if !defined(MAC_OS_X_VERSION_10_12) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
+NSCellImagePosition LeadingCellImagePosition() {
+ return ShouldDoExperimentalRTLLayout() ? NSImageRight : NSImageLeft;
+}
+NSCellImagePosition TrailingCellImagePosition() {
+ return ShouldDoExperimentalRTLLayout() ? NSImageLeft : NSImageRight;
+}
+#else
+NSCellImagePosition LeadingCellImagePosition() {
+ return NSImageLeading;
+}
+NSCellImagePosition TrailingCellImagePosition() {
+ return NSImageTrailing;
+}
+#endif // MAC_OS_X_VERSION_10_12
+
// Adapted from Apple's RTL docs (goo.gl/cBaFnT)
NSImage* FlippedImage(NSImage* image) {
const NSSize size = [image size];
« no previous file with comments | « chrome/browser/ui/cocoa/l10n_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698