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

Unified Diff: ui/base/cocoa/rtl_util.mm

Issue 2555033003: Add ScopedMacRTL class for Cocoa browser RTL testing (Closed)
Patch Set: Add to deps AFTER deps exists Created 4 years 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: ui/base/cocoa/rtl_util.mm
diff --git a/ui/base/cocoa/rtl_util.mm b/ui/base/cocoa/rtl_util.mm
new file mode 100644
index 0000000000000000000000000000000000000000..b7049db33830b1dbe1602b6fb1d384d9e2d190de
--- /dev/null
+++ b/ui/base/cocoa/rtl_util.mm
@@ -0,0 +1,25 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
Robert Sesek 2016/12/07 16:09:59 nit: no (c) in new files
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ui/base/cocoa/rtl_util.h"
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/i18n/rtl.h"
+#include "base/mac/mac_util.h"
+
+namespace cocoa_rtl_util {
Robert Sesek 2016/12/07 16:09:59 nit: blank lines on the inside of the namespace
+const base::Feature kExperimentalMacRTL{"ExperimentalMacRTL",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+bool ShouldDoExperimentalRTLLayout() {
+ return base::i18n::IsRTL() &&
+ base::FeatureList::IsEnabled(kExperimentalMacRTL);
+}
+
+bool ShouldFlipWindowControlsInRTL() {
+ return ShouldDoExperimentalRTLLayout() && base::mac::IsAtLeastOS10_12();
+}
+
+} // namespace cocoa_rtl_util

Powered by Google App Engine
This is Rietveld 408576698