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

Side by Side Diff: ios/chrome/browser/ui/rtl_geometry.mm

Issue 1320353003: Removed deprecated function IsRTLUILayout(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/rtl_geometry.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <limits> 7 #include <limits>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include "base/ios/ios_util.h" 10 #include "base/ios/ios_util.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 #pragma mark - autolayout utilities 210 #pragma mark - autolayout utilities
211 211
212 NSLayoutFormatOptions LayoutOptionForRTLSupport() { 212 NSLayoutFormatOptions LayoutOptionForRTLSupport() {
213 if (UseRTLLayout()) { 213 if (UseRTLLayout()) {
214 return NSLayoutFormatDirectionLeadingToTrailing; 214 return NSLayoutFormatDirectionLeadingToTrailing;
215 } 215 }
216 return NSLayoutFormatDirectionLeftToRight; 216 return NSLayoutFormatDirectionLeftToRight;
217 } 217 }
218
219 #pragma mark - deprecated functions
220
221 bool IsRTLUILayout() {
222 if (base::ios::IsRunningOnIOS9OrLater()) {
223 #if __IPHONE_9_0
224 // Calling this method is better than using the locale on iOS9 since it will
225 // work with the right to left pseudolanguage.
226 return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:
227 UISemanticContentAttributeUnspecified] ==
228 UIUserInterfaceLayoutDirectionRightToLeft;
229 #endif
230 }
231 // Using NSLocale instead of base::i18n::IsRTL() in order to take into account
232 // right to left pseudolanguage correctly (which base::i18n::IsRTL() doesn't).
233 return [NSLocale characterDirectionForLanguage:
234 [[NSLocale currentLocale]
235 objectForKey:NSLocaleLanguageCode]] ==
236 NSLocaleLanguageDirectionRightToLeft;
237 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/rtl_geometry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698