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

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

Issue 2313723004: cocoa: flip window controls and profile switcher for RTL (Closed)
Patch Set: add ExperimentalMacRTL feature Created 4 years, 3 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.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/new_tab_button.mm
diff --git a/chrome/browser/ui/cocoa/new_tab_button.mm b/chrome/browser/ui/cocoa/new_tab_button.mm
index 6d467190b23c0aa5c5e088940a136e02e3a6b85c..cf766a10eb9441aa44cabcecb39ea66af935c64e 100644
--- a/chrome/browser/ui/cocoa/new_tab_button.mm
+++ b/chrome/browser/ui/cocoa/new_tab_button.mm
@@ -4,9 +4,11 @@
#import "chrome/browser/ui/cocoa/new_tab_button.h"
+#include "base/i18n/rtl.h"
#include "base/mac/foundation_util.h"
#include "base/mac/sdk_forward_declarations.h"
#import "chrome/browser/ui/cocoa/image_button_cell.h"
+#include "chrome/browser/ui/cocoa/l10n_util.h"
#include "chrome/browser/ui/cocoa/tabs/tab_view.h"
#include "chrome/grit/theme_resources.h"
#include "ui/base/cocoa/nsgraphics_context_additions.h"
@@ -412,12 +414,16 @@ + (NSBezierPath*)newTabButtonBezierPathWithLineWidth:(CGFloat)lineWidth {
[bezierPath closePath];
- // The SVG path is flipped for some reason, so flip it back.
- const CGFloat kSVGHeight = 32;
- NSAffineTransformStruct flipStruct = { 1, 0, 0, -1, 0, kSVGHeight };
- NSAffineTransform* flipTransform = [NSAffineTransform transform];
- [flipTransform setTransformStruct:flipStruct];
- [bezierPath transformUsingAffineTransform:flipTransform];
+ // The SVG path is flipped for some reason, so flip it back. However, in RTL,
+ // we'd need to flip it again below, so when in RTL mode just leave the flip
+ // out altogether.
+ if (!cocoa_l10n_util::ExperimentalMacRTLIsEnabled() || !base::i18n::IsRTL()) {
+ const CGFloat kSVGHeight = 32;
+ NSAffineTransformStruct flipStruct = {1, 0, 0, -1, 0, kSVGHeight};
+ NSAffineTransform* flipTransform = [NSAffineTransform transform];
+ [flipTransform setTransformStruct:flipStruct];
+ [bezierPath transformUsingAffineTransform:flipTransform];
+ }
// The SVG data is for the 2x version so scale it down.
NSAffineTransform* scaleTransform = [NSAffineTransform transform];
« no previous file with comments | « chrome/browser/ui/cocoa/l10n_util.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698