OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ios/chrome/browser/ui/rtl_geometry.h" | 5 #include "ios/chrome/browser/ui/rtl_geometry.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "ios/chrome/browser/ui/ui_util.h" | 11 #include "ios/chrome/browser/ui/ui_util.h" |
12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
13 bool UseRTLLayout() { | 17 bool UseRTLLayout() { |
14 return base::i18n::IsRTL(); | 18 return base::i18n::IsRTL(); |
15 } | 19 } |
16 | 20 |
17 base::i18n::TextDirection LayoutDirection() { | 21 base::i18n::TextDirection LayoutDirection() { |
18 return UseRTLLayout() ? base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT; | 22 return UseRTLLayout() ? base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT; |
19 } | 23 } |
20 | 24 |
21 #pragma mark - LayoutRects. | 25 #pragma mark - LayoutRects. |
22 | 26 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 274 } |
271 | 275 |
272 #pragma mark - autolayout utilities | 276 #pragma mark - autolayout utilities |
273 | 277 |
274 NSLayoutFormatOptions LayoutOptionForRTLSupport() { | 278 NSLayoutFormatOptions LayoutOptionForRTLSupport() { |
275 if (UseRTLLayout()) { | 279 if (UseRTLLayout()) { |
276 return NSLayoutFormatDirectionLeadingToTrailing; | 280 return NSLayoutFormatDirectionLeadingToTrailing; |
277 } | 281 } |
278 return NSLayoutFormatDirectionLeftToRight; | 282 return NSLayoutFormatDirectionLeftToRight; |
279 } | 283 } |
OLD | NEW |