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

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

Issue 2845003003: [Mac] Reverse bookmark buttons and menus in RTL (take 2) (Closed)
Patch Set: Go back to hardcoding image y offset 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
« chrome/browser/ui/cocoa/l10n_util.h ('K') | « 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..14bad9dd82675b209fa60a7ab3bf887c93a881bf 100644
--- a/chrome/browser/ui/cocoa/l10n_util.mm
+++ b/chrome/browser/ui/cocoa/l10n_util.mm
@@ -96,6 +96,23 @@ bool ShouldFlipWindowControlsInRTL() {
return ShouldDoExperimentalRTLLayout() && base::mac::IsAtLeastOS10_12();
}
+#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];
« chrome/browser/ui/cocoa/l10n_util.h ('K') | « 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