| 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 | |
| 17 bool UseRTLLayout() { | 13 bool UseRTLLayout() { |
| 18 return base::i18n::IsRTL(); | 14 return base::i18n::IsRTL(); |
| 19 } | 15 } |
| 20 | 16 |
| 21 base::i18n::TextDirection LayoutDirection() { | 17 base::i18n::TextDirection LayoutDirection() { |
| 22 return UseRTLLayout() ? base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT; | 18 return UseRTLLayout() ? base::i18n::RIGHT_TO_LEFT : base::i18n::LEFT_TO_RIGHT; |
| 23 } | 19 } |
| 24 | 20 |
| 25 #pragma mark - LayoutRects. | 21 #pragma mark - LayoutRects. |
| 26 | 22 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 270 } |
| 275 | 271 |
| 276 #pragma mark - autolayout utilities | 272 #pragma mark - autolayout utilities |
| 277 | 273 |
| 278 NSLayoutFormatOptions LayoutOptionForRTLSupport() { | 274 NSLayoutFormatOptions LayoutOptionForRTLSupport() { |
| 279 if (UseRTLLayout()) { | 275 if (UseRTLLayout()) { |
| 280 return NSLayoutFormatDirectionLeadingToTrailing; | 276 return NSLayoutFormatDirectionLeadingToTrailing; |
| 281 } | 277 } |
| 282 return NSLayoutFormatDirectionLeftToRight; | 278 return NSLayoutFormatDirectionLeftToRight; |
| 283 } | 279 } |
| OLD | NEW |