Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_IOS_IOS_UTIL_H_ |
| 6 | #define BASE_IOS_IOS_UTIL_H_ |
| 7 | |
avi | 9b6f4293 | 2015-12-26 22:15:14 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 10 | #include "base/base_export.h" |
justincohen | b83910d | 2016-01-08 23:49:43 | [diff] [blame] | 11 | #include "base/files/file_path.h" |
Sylvain Defresne | 86bce6f4 | 2024-02-13 13:04:36 | [diff] [blame] | 12 | #include "build/ios_buildflags.h" |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 13 | |
| 14 | namespace base { |
| 15 | namespace ios { |
| 16 | |
Matt Mueller | da639d63 | 2022-11-15 17:05:29 | [diff] [blame] | 17 | // Returns whether the operating system is iOS 16 or later. |
| 18 | BASE_EXPORT bool IsRunningOnIOS16OrLater(); |
| 19 | |
Joemer Ramos | 8e1ba3a | 2023-06-16 18:25:09 | [diff] [blame] | 20 | // Returns whether the operating system is iOS 17 or later. |
| 21 | BASE_EXPORT bool IsRunningOnIOS17OrLater(); |
| 22 | |
[email protected] | 1c95c21 | 2013-06-29 14:16:00 | [diff] [blame] | 23 | // Returns whether the operating system is at the given version or later. |
avi | 9b6f4293 | 2015-12-26 22:15:14 | [diff] [blame] | 24 | BASE_EXPORT bool IsRunningOnOrLater(int32_t major, |
| 25 | int32_t minor, |
| 26 | int32_t bug_fix); |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 27 | |
Louis Romero | a10fa5a2 | 2022-10-27 01:31:28 | [diff] [blame] | 28 | // Returns whether iOS is signaling that an RTL text direction should be used |
marq | b2238de | 2015-09-21 17:06:21 | [diff] [blame] | 29 | // regardless of the current locale. This should not return true if the current |
| 30 | // language is a "real" RTL language such as Arabic or Urdu; it should only |
| 31 | // return true in cases where the RTL text direction has been forced (for |
Louis Romero | a10fa5a2 | 2022-10-27 01:31:28 | [diff] [blame] | 32 | // example by using the "RTL Pseudolanguage" option when launching from Xcode). |
marq | f51b003 | 2015-08-10 08:55:17 | [diff] [blame] | 33 | BASE_EXPORT bool IsInForcedRTL(); |
| 34 | |
justincohen | b83910d | 2016-01-08 23:49:43 | [diff] [blame] | 35 | // Stores the |path| of the ICU dat file in a global to be referenced later by |
| 36 | // FilePathOfICUFile(). This should only be called once. |
| 37 | BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path); |
| 38 | |
| 39 | // Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise |
| 40 | // returns invalid FilePath. |
| 41 | BASE_EXPORT FilePath FilePathOfEmbeddedICU(); |
| 42 | |
Sylvain Defresne | 86bce6f4 | 2024-02-13 13:04:36 | [diff] [blame] | 43 | #if !BUILDFLAG(IS_IOS_APP_EXTENSION) |
Sylvain Defresne | 226653e | 2021-01-21 16:36:11 | [diff] [blame] | 44 | // Returns true iff multiple windows can be opened, i.e. when the multiwindow |
| 45 | // build flag is on, the device is running on iOS 13+ and it's a compatible |
| 46 | // iPad. |
| 47 | BASE_EXPORT bool IsMultipleScenesSupported(); |
Sylvain Defresne | 86bce6f4 | 2024-02-13 13:04:36 | [diff] [blame] | 48 | #endif |
Sylvain Defresne | 226653e | 2021-01-21 16:36:11 | [diff] [blame] | 49 | |
Justin Cohen | 0d4ed23 | 2022-02-04 15:27:16 | [diff] [blame] | 50 | // iOS 15 introduced pre-warming, which launches and then pauses the app, to |
| 51 | // speed up actual launch time. |
| 52 | BASE_EXPORT bool IsApplicationPreWarmed(); |
| 53 | |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 54 | } // namespace ios |
| 55 | } // namespace base |
| 56 | |
| 57 | #endif // BASE_IOS_IOS_UTIL_H_ |